|
Dear all,
How can I use OpenGL in C#?
Islam Hegazy
|
|
|
|
|
http://csgl.sourceforge.net/[^]
Mazy
"A useless but amusing fact is that if all the DNA in all the cells in a single human being were stretched out it would reach the moon and back eight thousand times." - Steve Jones
|
|
|
|
|
Does anyone know the if this is something already present in C# or will I have to figure out the file format to read dbxs?
------------------------------------
Proud owner of a Peacekeeper barbie
37,064+ lines of code in my basketball game and it still doesn't have a game engine. I rule =)
|
|
|
|
|
Have you try to import Outlook Express Message List/Mail Object or other COM component which exist and usable in c# too?
Mazy
"A useless but amusing fact is that if all the DNA in all the cells in a single human being were stretched out it would reach the moon and back eight thousand times." - Steve Jones
|
|
|
|
|
I am trying to use the method SizeOf to determine the size of a structure containing arrays, among other elements. I succeeded in doing this by using MarshalAs with UnmanagedType and SizeConst. This works for structures with simple arrays, but for more complicated structures (such as nested ones), it compiles and links, but bombs during execution.
Below is sample code, with comments indicating exactly which line of code makes it bomb, and exactly where it bombs.
Do you have any suggestions? (I am running on .NET)
Thank you very much.
using System ;
using System.IO ;
using System.Runtime.InteropServices;
public class classMain
{
public static void Main ()
{
System.Type type = typeof (CLASS.STRUCT) ;
/* Here it bombs: ===> */ int length = Marshal.SizeOf (type) ;
return ;
}
}
public class CLASS
{
[StructLayout(LayoutKind.Sequential, Pack=1, CharSet=CharSet.Ansi)]
public struct float_3
{
[MarshalAs( UnmanagedType.ByValArray, SizeConst= 3 )]
public float [] FLOAT ;
}
[StructLayout(LayoutKind.Sequential, Pack=1, CharSet=CharSet.Ansi)]
public struct float_3_3
{
[MarshalAs( UnmanagedType.ByValArray, SizeConst= 3 )]
public float_3 [] FLOAT_3 ;
}
[StructLayout(LayoutKind.Sequential, Pack=1, CharSet=CharSet.Ansi)]
public struct STRUCT
{
[MarshalAs( UnmanagedType.ByValArray, SizeConst= 10 )]
ushort [] USHORT ;
[MarshalAs( UnmanagedType.ByValArray, SizeConst= 2 )]
/* This makes it bomb: ===> */ public float_3_3 [] FLOAT_3_3 ;
}
}
zelbezach
|
|
|
|
|
can some1 tell me where to get a small instal file 4 C# or can some1 please send me a winzip or rar file with it in it
|
|
|
|
|
If you mean that you want the c# SDK you can download that free from the microsoft webpage. But then you must use the command prompt to compile your code. The most c# programmers use Visual studio.NET but this is very expensive.
There is also an opensource development app (called sharpdevelop) available at
http://www.icsharpcode.net/OpenSource/SD/
|
|
|
|
|
Okay, first of all you must understand that C# as a language cannot exist by itself (unless you want to write your own compiler). The C# compiler targets the Common Language Runtime (CLR), part of the .NET Framework, just like VB.NET, MC++, J#, Perl.NET, and MANY others. You have to download and install the .NET Framework, which is a 20+ MB install. You can't do squat without it (just like you can't build an application using C# and deploy it to a computer without the .NET Framework installed. This is a framework, just like Java uses a Java Virtual Machine. Without, it doesn't work. C/C++ also requires a runtime, just as VB6 and older does.
You can download the free runtime (includes compilers) from http://msdn.microsoft.com/netframework[^]. You can also download the SDK from this link, which includes additional utilities and the SDK documentation, which you really should read. You'll also find some helpful articles to get an overview of .NET from the link. Definitely do the reading and don't fumble around blind. Understanding how .NET works and where C# fits in, as well as having some idea of what is provided in the base class library is important in development.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
Hi. I am a beginner in C# and I have a question.
How can I include what my program needs in the instalation kit?
I know I can put dotnetfx.exe in my setup, but the file is to big.
Is there any other solutions?
Thanks
|
|
|
|
|
adyrds wrote:
I know I can put dotnetfx.exe in my setup, but the file is to big.
Is there any other solutions?
It is just like anything else. If the
end user doesn't have the requried runtime
then you have to put it there. I don't know
how you would ever get around that.
Granted .Net has the mother of all runtime.
Thank You
Bo Hunter
|
|
|
|
|
You can use something like NSIS and download it from MS on demand
jkerns
|
|
|
|
|
The .NET Framework is required for an application that uses the .NET Framework, just like you can't run a Java app without the JRE.
There are ways to bootstrap the setup, but this will either require that the .NET Framework setup be included with the installation media (on a CD, this is hardly an issue) or must be downloaded on-demand, which imposses network requirements for clients. For information about this, see Redistributing the .NET Framework[^] on MSDN. Also note that the Windows Installer project in VS.NET will automatically include a .NET MSM (merge module) and exlude it from the installation. This is because it is only meant to resolve dependencies of base class library assemblies for assemblies in your installation and is not a valid installation of the .NET Framework. This is also documented in the VS.NET help.
There are commercial ways to bootstrap the .NET Framework, as well as free ways. For commercial ways, I recommend Wise for Windows Installer[^], but you can use InstallShield too (as an installation consultant for several companies and a tester/user of both IDEs, I've always preferred Wise Solutions). You can also find many free alternatives, such as Enhanced .NET Bootstrap Setup[^] on CodeProject.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
|
I have a very simple problem
How can i create a popup menu
i know how to create menus, mainmenus and menuitems (I don't use the grafical studio.NET development interface, but i write all the code i need self)
a half year ago i use VB6 there i always used the method
PopUpMenu Menu1
I know there must be a very simple solution.
thanks to everyone who can help me
|
|
|
|
|
I am assuming you are using C#, hence your question in this forum. You will need to drag a Context Menu object onto your form which will be displayed in the component tray at the bottom. If you want to assign the specific context menu to a control (i.e.; treeview, textbox, etc), those object have a context menu property which you can specify.
- Nick Parker My Blog
|
|
|
|
|
Can I use direct Win32 API functions in C# or
I have to write extra dll file in Visual C++
where I can use Win32 API functions?
For examples can I direct in C# write code
for eject CD or I have to write a dll file
in Visual C++ where I can use Win32 API
functions?
|
|
|
|
|
|
Thank you very much ))
|
|
|
|
|
zlaty wrote:
Can I use direct Win32 API functions in C#
Yes. Serach for DllImport in MSDN and this site.
Mazy
"A useless but amusing fact is that if all the DNA in all the cells in a single human being were stretched out it would reach the moon and back eight thousand times." - Steve Jones
|
|
|
|
|
Thank you very much ))
|
|
|
|
|
Apparently we posted at the same minute but I obviously beat you by at least a second.
- Nick Parker My Blog
|
|
|
|
|
Damn to my slow connection.
Mazy
"A useless but amusing fact is that if all the DNA in all the cells in a single human being were stretched out it would reach the moon and back eight thousand times." - Steve Jones
|
|
|
|
|
Hello,
Here is my question.
I have a main class that contains my apps form, call it Form1.cs. The form has some text boxes.
Know, I added another class to my project, Other.cs, and I want this class to write text out to the text boxes on Form.cs.
The textbox is called textOut. I tried to use this line in Other.cs "Form1.textOut.Text = ..." but I get this error: An object reference is required for the nonstatic field, method, or property 'BurCoat1.Form1.textOut'
So do I have to create a Form1 object in Other.cs? One is already made in Form1's main method:
"Application.Run(new Form1());"
I tried to make a global Form1 object in Form1.cs and use that one, but it still didnt work.
Can someone give me some suggestions please or tell me what I am doing wrong?
Thanx a lot,
-Flack
|
|
|
|
|
|
You need to get a reference to the form in some way.
Form1.textOut.Text = ... doesn't work because you're addressing the class definition itself, not an instance of it. Creating a new Form1 object in Other won't work either (although it will compile) because it will be an entirely separate intance of Form1, not the one on your screen.
I don't know how your app is set up, but this should give you an idea of how to go about it:
public class Form1{
public Form1(){
...
Other other = new Other(this);
}
}
public class Other{
private Form1 frm1;
public Other(Form1 frm){
frm1 = frm;
}
public void WriteText(){
frm1.textOut.Text = "Howdy!";
}
}
In that code, you're giving Other a reference to the Form1 instance you're dealing with in its constructor, which is then being saved for future reference in a private field.
Charlie
if(!curlies){ return; }
|
|
|
|