curiousDev
Young grasshopper
- Aug 16, 2017
- 38
- 2
Hello again,
As I promised in previous post here is a small mapper which I have made for my purposes.
HIK SDK C++ - C#
WORD - ushort
DWORD - uint
LONG - int
char* - string
BYTE - byte
BOOL - bool
void* - IntPtr (if u want to assign null then use IntPtr.Zero)
LPVOID - IntPtr (if u want to assign null then use IntPtr.Zero)
HWND - IntPtr
wchar_t[] - StringBuilder (wchar_t[256] new StringBuilder(256))
Generally i have notices that any variable in Hik SDK with prefix LP is a pointer (to structures mostly) in that case we need to use ref keyword.
For example:
LONG NET_DVR_Login_V40( LPNET_DVR_USER_LOGIN_INFO pLoginInfo, LPNET_DVR_DEVICEINFO_V40 lpDeviceInfo);
struct
{ NET_DVR_DEVICEINFO_V30 struDeviceV30;
BYTE bySupportLock;
BYTE byRetryLoginTime;
BYTE byPasswordLevel; BYTE byRes1;
DWORD dwSurplusLockTime;
BYTE byCharEncodeType;
BYTE byRes2[255];
} NET_DVR_DEVICEINFO_V30,*LPNET_DVR_DEVICEINFO_V30;
As you can see LPNET_DVR_DEVICEINFO_V30 is a pointer type while NET_DVR_DEVICEINFO_V30 is non pointer type.
As I promised in previous post here is a small mapper which I have made for my purposes.
HIK SDK C++ - C#
WORD - ushort
DWORD - uint
LONG - int
char* - string
BYTE - byte
BOOL - bool
void* - IntPtr (if u want to assign null then use IntPtr.Zero)
LPVOID - IntPtr (if u want to assign null then use IntPtr.Zero)
HWND - IntPtr
wchar_t[] - StringBuilder (wchar_t[256] new StringBuilder(256))
Generally i have notices that any variable in Hik SDK with prefix LP is a pointer (to structures mostly) in that case we need to use ref keyword.
For example:
LONG NET_DVR_Login_V40( LPNET_DVR_USER_LOGIN_INFO pLoginInfo, LPNET_DVR_DEVICEINFO_V40 lpDeviceInfo);
struct
{ NET_DVR_DEVICEINFO_V30 struDeviceV30;
BYTE bySupportLock;
BYTE byRetryLoginTime;
BYTE byPasswordLevel; BYTE byRes1;
DWORD dwSurplusLockTime;
BYTE byCharEncodeType;
BYTE byRes2[255];
} NET_DVR_DEVICEINFO_V30,*LPNET_DVR_DEVICEINFO_V30;
As you can see LPNET_DVR_DEVICEINFO_V30 is a pointer type while NET_DVR_DEVICEINFO_V30 is non pointer type.