小弟做一个摄像头控制程序,需要调用摄像头厂家给的DLL,厂家给的VC.NET函数声明如下:
extern "C"
{ //how to enumerate multi-device, and select one to handle.
//first enumerate devices that are connecting to the PC(call GetVMCUVCDevCount()s).
//if you would like to print the device name string (call GetDevFriendlyNameByIndex())
//second, attach the special device you like.(using AttachUVCDeviceByIndex() function)
//end, detach all device(using  DetachUVCDeviceALL())
DECLDIR ULONG GetVMCUVCDevCount();
DECLDIR ULONG GetDevFriendlyNameByIndex(ULONG iIndex,TCHAR *DevName, ULONG DevNamesize);
DECLDIR BOOL AttachUVCDeviceByIndex(ULONG iIndex);
DECLDIR VOID DetachUVCDeviceALL(); //TRUE for a successful call, FALSE for any error.
//1 for Pressing the Snapshot key, 0 for no operation.
DECLDIR BOOL GetSnapShotStatus(BYTE *SnapShotbStatus);
}
我在VB中声明如下:
Private Declare Function GetSnapShotStatus Lib "UVCXUControl.dll" (ByRef Parm As Long) As Boolean
Private Declare Function GetVMCUVCDevCount Lib "UVCXUControl.dll" () As Long
Private Declare Function AttachUVCDeviceByIndex Lib "UVCXUControl.dll" (ByVal iIndex As Long) As Boolean
Private Declare Sub DetachUVCDeviceALL Lib "UVCXUControl.dll" ()
其中GetVMCUVCDevCount 可用,调用GetSnapShotStatus 时一直提醒实时错误“49”:DLL调用约定错误,
望高人帮忙解决!
谢谢