c ++ char **转换c#

时间:2012-12-11 08:24:11

标签: c# c++ marshalling

我有一个dll文件,结构定义如下,

typedef struct test{
    DWORD NOD;          // Number of the devices ready to work
    char **a;       // Array of 16 byte ASCII strings
    char **b;       // Array of 4 byte ASCII strings
} test; 

我想在c#声明这个结构,所以我知道我必须使用Marshal,但我该怎么做?

我的dll导入功能

[DllImport("USMCDLL.dll",CharSet=CharSet.Ansi)]
private static extern UInt32 USMC_Init(ref USMC_Devices str);   

我就像

一样使用它
Test DVS = new Test();

public void Init_()
{
    fonk(ref DVS);
}

0 个答案:

没有答案