请高手帮我把VC里调用DLL的.H文件转换为VB的.BAS文件
有几个问题,USHAORT和UCHAR对应VB的什么数据类型等,注释部分是原来vc代码,帮忙看一下我改过哪里不对,谢谢'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
'' HIKVISION DS-40xxHC'HF BOARD SYSTEM SDK ''
'' Copyright (c) 2002-2008 Hangzhou Hikvision digtial technology co,. ltd''
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
'--------------------------------------------------------------------------------
'#define FRAME_HEAD_MAGIC 0x03211546
'#define SYSTEM_SYNC_ID 2
Public Const FRAME_HEAD_MAGIC = &H3211546
Public Const SYSTEM_SYNC_ID = 2
'--------------------------------------------------------------------------------
''''''''''''''''''''''''''此处有问题,_OSD_BASE的第一个“_”在VB中不能为首字符,如何转换''''''''''''''''''
'#define _OSD_BASE 0x9000
'#define _OSD_YEAR4 _OSD_BASE+0
'#define _OSD_YEAR2 _OSD_BASE+1
'#define _OSD_MONTH3 _OSD_BASE+2
'#define _OSD_MONTH2 _OSD_BASE+3
'#define _OSD_DAY _OSD_BASE+4
'#define _OSD_WEEK3 _OSD_BASE+5
'#define _OSD_CWEEK1 _OSD_BASE+6
'#define _OSD_HOUR24 _OSD_BASE+7
'#define _OSD_HOUR12 _OSD_BASE+8
'#define _OSD_MINUTE _OSD_BASE+9
'#define _OSD_SECOND _OSD_BASE+10
Public Const OSD_BASE = &H9000
Public Const OSD_YEAR4 = OSD_BASE + 0
Public Const OSD_YEAR2 = OSD_BASE + 1
Public Const OSD_MONTH3 = OSD_BASE + 2
Public Const OSD_MONTH2 = OSD_BASE + 3
Public Const OSD_DAY = OSD_BASE + 4
Public Const OSD_WEEK3 = OSD_BASE + 5
Public Const OSD_CWEEK1 = OSD_BASE + 6
Public Const OSD_HOUR24 = OSD_BASE + 7
Public Const OSD_HOUR12 = OSD_BASE + 8
Public Const OSD_MINUTE = OSD_BASE + 9
Public Const OSD_SECOND = OSD_BASE + 10
''''''''''''''''''''''''''此处有问题,_OSD_BASE的第一个“_”在VB中不能为首字符,如何转换''''''''''''''''''
'--------------------------------------------------------------------------------
''''''''''''''''''''''''''此处有问题,无法确定USHORT和UCHAR对应的VB的数据类型,如何转换''''''''''''''''''
'typedef struct tagFrameInfo{
' ULONG SyncId; /* 00000000000000000000000000010b */
' ULONG Magic;
' USHORT FrameType; /* I frames , P frames or BBP frames Audio frames or dsp status etc */
' ULONG Length; /*lenth include this header */
' ULONG FrameNumber; /* serial number of this frame */
' UCHAR Breakable; /* indicate if stream breakable, you could restart new file(with PktSysHeader) if true */
' /*ULONG Ack;*/
' ULONG PTS; /* system clock when this frames is processed */
'}TMFRAME_HEADER, *PTMFRAME_HEADER;
Public Type tagFrameInfo
SyncId As Long
Magic As Long
FrameType As Integer
Length As Long
FrameNumber As Long
Breakable As Byte
PTS As Long
End Type
''''''''''''''''''''''''''此处有问题,无法确定USHORT和UCHAR对应的VB的数据类型,如何转换''''''''''''''''''
'--------------------------------------------------------------------------------
'typedef struct tagVersion{
' ULONG DspVersion, DspBuildNum;
' ULONG DriverVersion, DriverBuildNum;
' ULONG SDKVersion, SDKBuildNum;
'}VERSION_INFO, *PVERSION_INFO;
Public Type tagVersion
DspVersion As Long
DriverVersion As Long
SDKVersion As Long
End Type
'--------------------------------------------------------------------------------
'typedef enum {
' StandardNone = 0x80000000,
' StandardNTSC = 0x00000001,
' StandardPAL = 0x00000002,
' StandardSECAM = 0x00000004,
'} VideoStandard_t;
Public Enum VideoStandard_t
StandardNone = &H80000000
StandardNTSC = &H1
StandardPAL = &H2
StandardSECAM = &H4
End Enum
'--------------------------------------------------------------------------------
'typedef enum {
' PktError = 0,
' PktIFrames = 0x0001,
' PktPFrames = 0x0002,
' PktBBPFrames = 0x0004,
' PktAudioFrames = 0x0008,
' PktMotionDetection = 0x00010,
' PktDspStatus = 0x00020,
' PktOrigImage = 0x00040,
' PktSysHeader = 0x00080,
' PktBPFrames = 0x00100,
' PktSFrames = 0x00200,
' PktSubIFrames = 0x00400,
' PktSubPFrames = 0x00800,
' PktSubBBPFrames = 0x01000,
' PktSubSysHeader = 0x02000
'}FrameType_t;
Public Enum FrameType_t
PktError = 0
PktIFrames = &H1
PktPFrames = &H2
PktBBPFrames = &H4
PktAudioFrames = &H8
PktMotionDetection = &H10
PktDspStatus = &H20
PktOrigImage = &H40
PktSysHeader = &H80
PktBPFrames = &H100
PktSFrames = &H200
PktSubIFrames = &H400
PktSubPFrames = &H800
PktSubBBPFrames = &H1000
PktSubSysHeader = &H200
End Enum
'--------------------------------------------------------------------------------
'typedef enum {
' ENC_CIF_FORMAT = 0,
' ENC_QCIF_FORMAT = 1,
' ENC_2CIF_FORMAT = 2,
' ENC_4CIF_FORMAT = 3,
' ENC_QQCIF_FORMAT = 4,
' ENC_CIFQCIF_FORMAT =5,
' ENC_CIFQQCIF_FORMAT =6,
' ENC_DCIF_FORMAT =7,
' ENC_VGA_FORMAT = 8
'}PictureFormat_t;
Public Enum PictureFormat_t
ENC_CIF_FORMAT = 0
ENC_QCIF_FORMAT = 1
ENC_2CIF_FORMAT = 2
ENC_4CIF_FORMAT = 3
ENC_QQCIF_FORMAT = 4
ENC_CIFQCIF_FORMAT = 5
ENC_CIFQQCIF_FORMAT = 6
ENC_DCIF_FORMAT = 7
ENC_VGA_FORMAT = 8
End Enum
'--------------------------------------------------------------------------------
''''''''''''''''''''''''''此处有问题,无法确定PictureFormat_t PicFormat的数据类型,如何转换''''''''''''''''''
'typedef struct tagMotionData{
' PictureFormat_t PicFormat;
' ULONG HorizeBlocks;
' ULONG VerticalBlocks;
' ULONG BlockSize;
'}MOTION_DATA_HEADER, *PMOTION_DATA_HEADER;
Public Type tagMotionData
PictureFormat_t PicFormat
HorizeBlocks As Long
VerticalBlocks As Long
BlockSize As Long
End Type
''''''''''''''''''''''''''此处有问题,无法确定PictureFormat_t PicFormat的数据类型,如何转换''''''''''''''''''
--------------------编程问答-------------------- 还有
'--------------------------------------------------------------------------------
'#define DRAWFUN(x) void (CALLBACK* x)(long nPort,HDC hDc,LONG nUser)
'--------------------------------------------------------------------------------
'typedef void (*LOGRECORD_CALLBACK)(char *str, void *context);
'typedef int (*STREAM_READ_CALLBACK)(ULONG channelNumber, void *context);
'typedef int (*STREAM_DIRECT_READ_CALLBACK)(ULONG channelNumber,void *DataBuf,DWORD Length,int FrameType,void *context);
'--------------------------------------------------------------------------------
''''''''''''''''''''''''''此处有问题,无法确定UCHAR对应的VB的数据类型,如何转换''''''''''''''''''
'typedef struct tagChannelCapability{
' UCHAR bAudioPreview;
' UCHAR bAlarmIO;
' UCHAR bWatchDog;
'}CHANNEL_CAPABILITY, *PCHANNEL_CAPABILITY;
Public Type tagChannelCapability
bAudioPreview As Byte
bAlarmIO As Byte
bWatchDog As Byte
End Type
''''''''''''''''''''''''''此处有问题,无法确定UCHAR对应的VB的数据类型,如何转换''''''''''''''''''
'--------------------------------------------------------------------------------
'typedef struct tagFramsStatistics{
' ULONG VideoFrames;
' ULONG AudioFrames;
' ULONG FramesLost;
' ULONG QueueOverflow;
' ULONG CurBps;
'}FRAMES_STATISTICS, *PFRAMES_STATISTICS;
Public Type agFramsStatistics
VideoFrames As Long
AudioFrames As Long
FramesLost As Long
QueueOverflow As Long
CurBps As Long
End Type
'--------------------------------------------------------------------------------
'DLLEXPORT_API int __stdcall InitDSPs();
Public Declare Function InitDSPs Lib "Ds40xxSDK.dll" () As Long
'DLLEXPORT_API int __stdcall DeInitDSPs();
Public Declare Function DeInitDSPs Lib "Ds40xxSDK.dll" () As Long
'DLLEXPORT_API HANDLE __stdcall ChannelOpen(int ChannelNum);
Public Declare Function ChannelOpen Lib "Ds40xxSDK.dll" (ByVal ChannelNum As Long) As Long
'DLLEXPORT_API int __stdcall ChannelClose(HANDLE hChannelHandle);
Public Declare Function ChannelClose Lib "Ds40xxSDK.dll" (ByVal hChannelHandle As Long) As Long
'DLLEXPORT_API int __stdcall GetTotalChannels();
Public Declare Function GetTotalChannels Lib "Ds40xxSDK.dll" () As Long
'DLLEXPORT_API int __stdcall GetTotalDSPs();
Public Declare Function GetTotalDSPs Lib "Ds40xxSDK.dll" () As Long
'''''''''''''''''''''''''''''''''''''此处有问题,RECT *rect如何转换'''''''''''''''''''
'DLLEXPORT_API int __stdcall StartVideoPreview(HANDLE hChannelHandle,HWND WndHandle, RECT *rect, BOOLEAN bOverlay, int VideoFormat, int FrameRate);
Public Declare Function StartVideoPreview Lib "Ds40xxSDK.dll" (ByVal hChannelHandle As Long, _
ByVal WndHandle As Long, ByRef rect As Long, ByVal bOverlay As Boolean, _
ByVal VideoFormat As Long, ByVal FrameRate As Long) As Long
'''''''''''''''''''''''''''''''''''''此处有问题,RECT *rect如何转换'''''''''''''''''''
'DLLEXPORT_API int __stdcall StopVideoPreview(HANDLE hChannelHandle);
Public Declare Function StopVideoPreview Lib "Ds40xxSDK.dll" (ByVal hChannelHandle As Long) As Long
'DLLEXPORT_API int __stdcall SetVideoPara(HANDLE hChannelHandle, int Brightness, int Contrast, int Saturation, int Hue);
Public Declare Function SetVideoPara Lib "Ds40xxSDK.dll" (ByVal hChannelHandle As Long, _
ByVal Brightness As Long, ByVal Contrast As Long, ByVal Saturation As Long, _
ByVal Hue As Long) As Long
'''''''''''''''''''''''''''''''''''''此处有问题,VideoStandard_t *VideoStandard等如何转换'''''''''''''''''''
'DLLEXPORT_API int __stdcall GetVideoPara(HANDLE hChannelHandle, VideoStandard_t *VideoStandard, int *Brightness, int *Contrast, int *Saturation, int *Hue);
Public Declare Function GetVideoPara Lib "Ds40xxSDK.dll" (ByVal hChannelHandle As Long, ByRef VideoStandard As Long, _
ByRef Brightness As Long, ByRef Contrast As Long, ByRef Saturation As Long, _
ByRef Hue As Long) As Long
'''''''''''''''''''''''''''''''''''''此处有问题,VideoStandard_t *VideoStandard等如何转换'''''''''''''''''''
'DLLEXPORT_API int __stdcall GetVideoSignal(HANDLE hChannelHandle);
Public Declare Function GetVideoSignal Lib "Ds40xxSDK.dll" (ByVal hChannelHandle As Long) As Long
'''''''''''''''''''''''''''''''''''''此处有问题,PVERSION_INFO VersionInfo如何转换'''''''''''''''''''
'DLLEXPORT_API int __stdcall GetSDKVersion(PVERSION_INFO VersionInfo);
Public Declare Function GetSDKVersion Lib "Ds40xxSDK.dll" (ByVal VersionInfo As Long) As Long
'''''''''''''''''''''''''''''''''''''此处有问题,PVERSION_INFO VersionInfo如何转换'''''''''''''''''''
'''''''''''''''''''''''''''''''''''''此处有问题,CHANNEL_CAPABILITY *Capability如何转换'''''''''''''''''''
'DLLEXPORT_API int __stdcall GetCapability(HANDLE hChannelHandle, CHANNEL_CAPABILITY *Capability);
Public Declare Function GetCapability Lib "Ds40xxSDK.dll" (ByVal hChannelHandle As Long, ByRef Capability As Long) As Long
'''''''''''''''''''''''''''''''''''''此处有问题,CHANNEL_CAPABILITY *Capability如何转换'''''''''''''''''''
'DLLEXPORT_API int __stdcall GetLastErrorNum(HANDLE hChannelHandle, ULONG *DspError, ULONG *SdkError);
Public Declare Function GetLastErrorNum Lib "Ds40xxSDK.dll" (ByVal hChannelHandle As Long, _
ByRef DspError As Long, ByRef SdkError As Long) As Long
''''''''''''''''''''''''''此处有问题,无法确定USHORT对应的VB的数据类型,USHORT Type如何转换''''''''''''''''''
'DLLEXPORT_API int __stdcall SetStreamType(HANDLE hChannelHandle, USHORT Type);
Public Declare Function SetStreamType Lib "Ds40xxSDK.dll" (ByVal hChannelHandle As Long, ByVal Type1 As Long) As Long
''''''''''''''''''''''''''此处有问题,无法确定USHORT对应的VB的数据类型,USHORT Type如何转换''''''''''''''''''
''''''''''''''''''''''''''此处有问题,无法确定USHORT对应的VB的数据类型,USHORT *StreamType如何转换''''''''''''''''''
'DLLEXPORT_API int __stdcall GetStreamType(HANDLE hChannelHandle, USHORT *StreamType);
Public Declare Function SetStreamType Lib "Ds40xxSDK.dll" (ByVal hChannelHandle As Long, ByRef StreamType As Long) As Long
''''''''''''''''''''''''''此处有问题,无法确定USHORT对应的VB的数据类型,USHORT *StreamType如何转换''''''''''''''''''
''''''''''''''''''''''''''此处有问题,PFRAMES_STATISTICS framesStatistics如何转换''''''''''''''''''
'DLLEXPORT_API int __stdcall GetFramesStatistics(HANDLE hChannelHandle, PFRAMES_STATISTICS framesStatistics);
Public Declare Function GetFramesStatistics Lib "Ds40xxSDK.dll" (ByVal hChannelHandle As Long, ByVal framesStatistics As Long) As Long
''''''''''''''''''''''''''此处有问题,PFRAMES_STATISTICS framesStatistics如何转换''''''''''''''''''
'DLLEXPORT_API int __stdcall StartMotionDetection(HANDLE hChannelHandle);
Public Declare Function StartMotionDetection Lib "Ds40xxSDK.dll" (ByVal hChannelHandle As Long) As Long
'DLLEXPORT_API int __stdcall GetBoardInfo(HANDLE hChannelHandle, ULONG *BoardType, UCHAR *SerialNo);
Public Declare Function GetBoardInfo Lib "Ds40xxSDK.dll" (ByVal hChannelHandle As Long, ByRef BoardType As Long, _
ByRef SerialNo As Long) As Long
'DLLEXPORT_API int __stdcall StopMotionDetection(HANDLE hChannelHandle);
Public Declare Function StopMotionDetection Lib "Ds40xxSDK.dll" (ByVal hChannelHandle As Long) As Long
--------------------编程问答-------------------- 在VB中找到存储字节数与USHAORT和UCHAR的存储字节数相同的数据类型
补充:VB , API