请耐心等待,因为我是新来的编组人员.我有一个C结构和函数声明如下:
typedef struct
{
char* name;
BT_ADDR address;
} DeviceList;
extern "C" _declspec(dllexport)DeviceList* PerformQuery();
Run Code Online (Sandbox Code Playgroud)
BT_ADDR结构与Win CE SDK中wsbth2.h中定义的结构相同.PerformQuery返回指向DeviceList数组的指针.
在我的C#程序中,我执行以下pinvoke声明,如下所示
[StructLayout(LayoutKind.Sequential)]
struct DeviceList
{
public string name;
public ulong address;
}
[DllImport("BT_Conn.dll")]
public extern static DeviceList[] PerformQuery();
Run Code Online (Sandbox Code Playgroud)
运行C#程序后,返回NotSupportedException.你能告诉我我的编组有什么问题吗?