Hi!
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:
and
In my c# code i have:
and
I fill the array before calling this delegate and i
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?
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:
Code:
int __export __stdcallInsertStruct(int countS, AInfo info[11])
Code:
typedef struct
{
char* a;
char b;
char* c;
}AInfo;
Code:
[StructLayout(LayoutKind.Sequential)]
public struct AInfo
{
public string a;
public char b;
public string c;
}
Code:
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?
Comment