L
Linus Rörstad
Hello!
I'm having problems with getting the size of my own class. The exception I
get is:
Type SocketProtocol.Inparameters can not be marshaled as an unmanaged
structure; no meaningful size or offset can be computed
The class looks like this:
public class Inparameters
{
public enum SyncType
{
Full,
Simple
}
public string id2;
public string id;
public SyncType synctype;
}
Inparameters inparameter = new Inparameters();
inparameter.id = textBox2.Text;
inparameter.synctype = SocketProtocol.Inparameters.SyncType.Full;
int a = Marshal.SizeOf(inparameter);
It's when I call the last line I receive the exception
What am I doing wrong?
Thanks
Linus
I'm having problems with getting the size of my own class. The exception I
get is:
Type SocketProtocol.Inparameters can not be marshaled as an unmanaged
structure; no meaningful size or offset can be computed
The class looks like this:
public class Inparameters
{
public enum SyncType
{
Full,
Simple
}
public string id2;
public string id;
public SyncType synctype;
}
Inparameters inparameter = new Inparameters();
inparameter.id = textBox2.Text;
inparameter.synctype = SocketProtocol.Inparameters.SyncType.Full;
int a = Marshal.SizeOf(inparameter);
It's when I call the last line I receive the exception
What am I doing wrong?
Thanks
Linus