I want to call a function from a c++ unmanaged dll but i'm having a hard time in doing it because of an array parameter.
the definition in c++ of the method is:
Expand|Select|Wrap|Line Numbers
- int __export __stdcallInsertStruct(int countS, AInfo info[11])
Expand|Select|Wrap|Line Numbers
- typedef struct
- {
- char* a;
- char b;
- char* c;
- }AInfo;
Expand|Select|Wrap|Line Numbers
- [StructLayout(LayoutKind.Sequential)]
- public struct AInfo
- {
- public string a;
- public char b;
- public string c;
- }
Expand|Select|Wrap|Line Numbers
- private delegate IntPtr InsertStructDelegate(int countS, AInfo[] info);
can't manage to get this to work. Always get an error of broken memory.
do i have to use another type instead of AInfo[] in my method definition?
Like IntPtr or byte[]?
Can someone help me with this one?