win32 datatype in C#.NET
-
HI, how to use win32 datatype in c#.NET am using [DllImport("Kernel32", CharSet=CharSet.Auto)] private unsafe static extern UInt32 CreateIoCompletionPort(UInt32 hFile, UInt32 hExistingCompletionPort, UInt32* puiCompletionKey, UInt32 uiNumberOfConcurrentThreads); this function , n i wants to pass a socket to ist parameter as a handle and when i convert socket to UInt32 it gives me INVALID CAST EXCEPTION so how i pass socket to UInt32 hFile this argument.??? please help me ........... Thanks babur.saeed@gmail.com its_me_babar@yahoo.com Babar
-
HI, how to use win32 datatype in c#.NET am using [DllImport("Kernel32", CharSet=CharSet.Auto)] private unsafe static extern UInt32 CreateIoCompletionPort(UInt32 hFile, UInt32 hExistingCompletionPort, UInt32* puiCompletionKey, UInt32 uiNumberOfConcurrentThreads); this function , n i wants to pass a socket to ist parameter as a handle and when i convert socket to UInt32 it gives me INVALID CAST EXCEPTION so how i pass socket to UInt32 hFile this argument.??? please help me ........... Thanks babur.saeed@gmail.com its_me_babar@yahoo.com Babar
Handle dataTypes in C# must be IntPtr, therefor you procedure should look like this :
[DllImport("Kernel32")]
private static extern IntPtr CreateIoCompletionPort(IntPtr hFile, IntPtr hExistingCompletionPort, IntPtr puiCompletionKey, IntPtr uiNumberOfConcurrentThreads);I hope you understand... By the way... visit http://nehe.gamedev.net[^]
-
Handle dataTypes in C# must be IntPtr, therefor you procedure should look like this :
[DllImport("Kernel32")]
private static extern IntPtr CreateIoCompletionPort(IntPtr hFile, IntPtr hExistingCompletionPort, IntPtr puiCompletionKey, IntPtr uiNumberOfConcurrentThreads);I hope you understand... By the way... visit http://nehe.gamedev.net[^]
-
Thank u very much i have solved the problem,,,,,,,, but now stuck into another problem :sigh: can u help me if i send u code?
Yes, at least I will try. I hope you understand... By the way... visit http://nehe.gamedev.net[^]