[StructLayout(LayoutKind.Sequential)]
private struct RC_HARDWARE_INFO
{
int lSerialNumber;
int lCurrentNumber;
byte bDogType;
string bDogModel;
}
[DllImport("RCGrandDogW32.dll", EntryPoint = "RC_OpenDog", CharSet = CharSet.Ansi,
CallingConvention = CallingConvention.StdCall)]
private int RC_OpenDog(uint ulFlag, string pszProductName, int pDogHandle);
[DllImport("RCGrandDogW32.dll", EntryPoint = "RC_GetDogInfo", CharSet = CharSet.Ansi,
CallingConvention = CallingConvention.StdCall)]
private int RC_GetDogInfo(uint DogHandle, RC_HARDWARE_INFO pHardwareInfo, uint pulLen);
这个怎么老是出现
'MyDogClassTest.GrandDog.RC_openDog(uint, string, int)' must declare a body because it is not marked abstract, extern, or partial这个错误,高手帮一下,谢谢
Dll c#的引入错误
答案:3 悬赏:40 手机版
解决时间 2021-02-09 07:59
- 提问者网友:低吟詩仙的傷
- 2021-02-08 17:45
最佳答案
- 五星知识达人网友:动情书生
- 2021-02-08 19:19
private extern int RC_OpenDog(uint ulFlag, string pszProductName, int pDogHandle);
private extern int RC_GetDogInfo(uint DogHandle, RC_HARDWARE_INFO pHardwareInfo, uint pulLen);
private extern int RC_GetDogInfo(uint DogHandle, RC_HARDWARE_INFO pHardwareInfo, uint pulLen);
全部回答
- 1楼网友:刀戟声无边
- 2021-02-08 21:15
加out参数试试
- 2楼网友:孤独的牧羊人
- 2021-02-08 20:47
static函数可以直接用类名调用 ,但非static就必须把类实例化后才能调用 .
我要举报
如以上问答信息为低俗、色情、不良、暴力、侵权、涉及违法等信息,可以点下面链接进行举报!
大家都在看
推荐资讯