G
Guest
Hi there,
I am very curious on this code:
// declared as structure
[ StructLayout( LayoutKind.Sequential )]
public struct Overlapped
{
public IntPtr intrnal;
public IntPtr internalHigh;
public int offset;
public int offsetHigh;
public IntPtr hEvent;
}
// declared as class
[ StructLayout( LayoutKind.Sequential )]
public class Overlapped2
{
public IntPtr intrnal;
public IntPtr internalHigh;
public int offset;
public int offsetHigh;
public IntPtr hEvent;
}
This is the first time i saw people declaring in Class and later using into platform invocation.
So what is the performance of using class or structures.
As i need to do some low level stuff like smart card, based on my seniors, you need to past structures when you want to write some data into the card. Instead of using structures, can it be done with class too?
Well, i not sure how to explain, but something like this. What are the advantages and disadvantages of using class or structs?
Thanks.
I am very curious on this code:
// declared as structure
[ StructLayout( LayoutKind.Sequential )]
public struct Overlapped
{
public IntPtr intrnal;
public IntPtr internalHigh;
public int offset;
public int offsetHigh;
public IntPtr hEvent;
}
// declared as class
[ StructLayout( LayoutKind.Sequential )]
public class Overlapped2
{
public IntPtr intrnal;
public IntPtr internalHigh;
public int offset;
public int offsetHigh;
public IntPtr hEvent;
}
This is the first time i saw people declaring in Class and later using into platform invocation.
So what is the performance of using class or structures.
As i need to do some low level stuff like smart card, based on my seniors, you need to past structures when you want to write some data into the card. Instead of using structures, can it be done with class too?
Well, i not sure how to explain, but something like this. What are the advantages and disadvantages of using class or structs?
Thanks.