1

我有一个 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);
}
4

0 回答 0