问题描述
- C# 托管的 PInvoke 签名与非托管的目标签名不匹配
-
CLIENT_API BOOL CALL_METHOD CLIENT_SnapPicture(LLONG lLoginID, SNAP_PARAMS par);typedef struct _snap_param
{
unsigned int Channel;
unsigned int Quality;
unsigned int ImageSize;
unsigned int mode;
unsigned int InterSnap;
unsigned int CmdSerial;
unsigned int Reserved[4];
} SNAP_PARAMS, *LPSNAP_PARAMS;[DllImport("dhnetsdk.dll")]
public static extern bool CLIENT_SnapPicture(int lLoginID, SNAP_PARAMS par);[StructLayout(LayoutKind.Sequential)]
public struct SNAP_PARAMS
{
public uint Channel;
public uint Quality;
public uint ImageSize;
public uint mode;
public uint InterSnap;
public uint CmdSerial;
public uint Reserved;
};
解决方案
函数原型定义有问题,问厂家要开发文档。
时间: 2024-10-31 01:47:55