Click here to Skip to main content
15,892,480 members
Home / Discussions / C#
   

C#

 
GeneralRe: Mutex Not Working Pin
Dwayner799-Aug-05 4:19
Dwayner799-Aug-05 4:19 
GeneralRe: Mutex Not Working Pin
Dwayner799-Aug-05 4:42
Dwayner799-Aug-05 4:42 
GeneralRe: Mutex Not Working Pin
jan larsen9-Aug-05 8:53
jan larsen9-Aug-05 8:53 
GeneralRe: Mutex Not Working Pin
Dwayner799-Aug-05 11:17
Dwayner799-Aug-05 11:17 
GeneralC# Video Pin
magnifique8-Aug-05 6:30
magnifique8-Aug-05 6:30 
GeneralRe: C# Video Pin
Dave Kreskowiak8-Aug-05 6:49
mveDave Kreskowiak8-Aug-05 6:49 
QuestionC# and old "C" Dlls Pin
Mike Doner8-Aug-05 5:59
Mike Doner8-Aug-05 5:59 
GeneralRe: C# and old "C" Dlls Pin
LobsterDK8-Aug-05 9:17
LobsterDK8-Aug-05 9:17 
Yes, as with the requirement of defining the function signature in C# you also have to supply a description of the structure as well. For the structure you provided the sig would be

[StructLayout(LayoutKind.Sequential)]
struct SerialInfoMD
{
[MarshalAs(UnmanagedType.ByValArray, SizeConst=8)]
public byte[] ID;
public byte Something;
public int New; // note the capitalization change. Syntax error otherwise.
}

Things can get tricky when marshalling data between managed and unmanaged code. For example, in your function signature you have the return type as ulong. Is the return type for the C function an unsigned long? Unsigned long is 32-bits on Win32 but is 64-bits on .NET so the appropriate return type in the C# method is uint if the return type on the C function is unsigned long. It gets even more murky when dealing with arrays. You might wanna check out information on data marshalling on MSDN. Try this URL for a start.

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpguide/html/cpconInteropMarshaling.asp

GeneralChange ScrollBar Color for ListView Pin
blueguitar18-Aug-05 5:54
blueguitar18-Aug-05 5:54 
GeneralRe: Change ScrollBar Color for ListView Pin
Guffa8-Aug-05 7:18
Guffa8-Aug-05 7:18 
GeneralRe: Change ScrollBar Color for ListView Pin
Alomgir Miah8-Aug-05 8:01
Alomgir Miah8-Aug-05 8:01 
QuestionHow to create a Bitmap from a DataGrid Pin
Rick Beideman8-Aug-05 5:40
Rick Beideman8-Aug-05 5:40 
GeneralProblems with Designer executing property's code Pin
Stephen Caldwell8-Aug-05 3:45
Stephen Caldwell8-Aug-05 3:45 
GeneralRe: Problems with Designer executing property's code Pin
leppie8-Aug-05 4:08
leppie8-Aug-05 4:08 
GeneralWebService problem Pin
Dario Solera8-Aug-05 3:41
Dario Solera8-Aug-05 3:41 
GeneralRe: WebService problem Pin
leppie8-Aug-05 4:12
leppie8-Aug-05 4:12 
GeneralRe: WebService problem Pin
Dario Solera8-Aug-05 4:15
Dario Solera8-Aug-05 4:15 
GeneralComboBox Pin
zaboboa8-Aug-05 3:11
zaboboa8-Aug-05 3:11 
GeneralRe: ComboBox Pin
Alomgir Miah8-Aug-05 3:23
Alomgir Miah8-Aug-05 3:23 
GeneralRe: ComboBox Pin
zaboboa8-Aug-05 3:25
zaboboa8-Aug-05 3:25 
GeneralRe: ComboBox Pin
Alomgir Miah8-Aug-05 4:02
Alomgir Miah8-Aug-05 4:02 
GeneralRe: ComboBox Pin
Mohamad Al Husseiny8-Aug-05 4:05
Mohamad Al Husseiny8-Aug-05 4:05 
GeneralCreating DTS Packages in C# Pin
JMichael24688-Aug-05 3:05
JMichael24688-Aug-05 3:05 
GeneralRe: Creating DTS Packages in C# Pin
JMichael24688-Aug-05 8:27
JMichael24688-Aug-05 8:27 
Generalreading XML from a string Pin
Mridang Agarwalla8-Aug-05 3:01
Mridang Agarwalla8-Aug-05 3:01 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.