|
ms
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
unmanaged structs in struct with c#I can't get that to work and I don't know why. Simplified I have the following structs (Just a snip): typedef struct { char* name; int type; Parameters1 otherStruct; Parameters2 otherStruct2; unsigned int lastUsed; } TestStruct,*PTestStruct; typedef struct Parameters1 { Parameters3 otherStruct3; Parameters4 otherStruct4 }Parameters1; ....... I tried this C# class for that: [StructLayout(LayoutKind.Sequential)] public class TestStruct { [MarshalAs(UnmanagedType.LPStr)] public string name; public int type; public Parameters1 otherStruct; public Parameters2 otherStruct2 public uint lastUsed; } But it doesn't work. Any idea what's going wrong here? Thanks. greetings juergen >But it doesn't work. In what way is it failing?Mattias -- Mattias Sjögren [C# MVP] mattias @ mvps.org http://www.msjogren.net/dotnet/ | http://www.dotnetinterop.com Please reply only to the newsgroup.
Other interesting topics
When, why and where should a struct be used?
BackGroundWorker Problem assigning event handler to object.event XML Querying .....??? Retrieving the COM class factory for a component failed moving selected item Reading from .DBF in DBaseIII DateTime formatting Restricting rows via rowfilter? Basic Databinding Question C# |
|||||||||||||||||||||||