Please bear with me as i am new to marshalling. I have a C structure and function declared as the following:
typedef struct
{
char* name;
BT_ADDR address;
} DeviceList;
extern "C" _declspec(dllexport)DeviceList* PerformQuery();
The BT_ADDR structure is the same structure defined in wsbth2.h in Win CE SDK. PerformQuery returns a pointer to an array of DeviceList.
In my C# program, i perform the following pinvoke declaration as followed
[StructLayout(LayoutKind.Sequential)]
struct DeviceList
{
public string name;
public ulong address;
}
[DllImport("BT_Conn.dll")]
public extern static DeviceList[] PerformQuery();
After running the C# program, a NotSupportedException is returned. Can you kindly advise me what is wrong with my marshalling?