M
MobileDeveloper
Good day.
I am developing a mobile application in Vb.Net 2003 that runs on a
windows CE.Net mobile device. The device came with a whole bunch of c
dll's from the manufacturers. I have the c header files (.h) and after
much research, I learned that the function names in the actual dlls
were "mangled".
Using "dumpbin.exe /exports" I managed to get the actual function
names and call them. Now my problem is that I'm not too clued up on C
to be able to convert the struct's to VB structures.
As an example, lets work with: sgFingerPrintDevice.dll
In the header file, one of the functions is defined as:
DI_FP_DLL UINT DIFingerprint_GetVersion(VOID);
This is how I reference it from my mobile application:
Public Declare Function DIFingerprint_GetVersion Lib
"sgFingerPrintDevice.Dll" Alias "?DIFingerprint_GetVersion@@YAIXZ" ()
As Integer
I can call this function and get the version without problems.
The next function in the dll is:
DI_FP_DLL STATUS_CODE DIFingerprint_OpenDevice
(fingerprintDeviceSTRUCT* fingerprintInfo);
struct fingerprintDeviceSTRUCT
{
DWORD dwSize;
HANDLE hDevice;
VOID* pDeviceInfo;
BOOL fIsListening;
BOOL fIsScanning;
HWND hwndTarget;
UINT nTargetMessageID;
BOOL (*GetImage) (VOID* pInfo, VOID* pBuffer, UINT* pnSize);
BOOL (*ChangeSetting) (VOID* pInfo,
UINT nID,
VOID* pValue,
UINT nValueSize);
};
What I need is the Vb structure of this C struct, and more
importantly, a way to convert any other structure - other than posting
all the header files and expecting someone to do it for me.
Something like:
Public Structure fingerprintDeviceSTRUCT
Dim dwSize As String
...
End Structure
Thank you.
I am developing a mobile application in Vb.Net 2003 that runs on a
windows CE.Net mobile device. The device came with a whole bunch of c
dll's from the manufacturers. I have the c header files (.h) and after
much research, I learned that the function names in the actual dlls
were "mangled".
Using "dumpbin.exe /exports" I managed to get the actual function
names and call them. Now my problem is that I'm not too clued up on C
to be able to convert the struct's to VB structures.
As an example, lets work with: sgFingerPrintDevice.dll
In the header file, one of the functions is defined as:
DI_FP_DLL UINT DIFingerprint_GetVersion(VOID);
This is how I reference it from my mobile application:
Public Declare Function DIFingerprint_GetVersion Lib
"sgFingerPrintDevice.Dll" Alias "?DIFingerprint_GetVersion@@YAIXZ" ()
As Integer
I can call this function and get the version without problems.
The next function in the dll is:
DI_FP_DLL STATUS_CODE DIFingerprint_OpenDevice
(fingerprintDeviceSTRUCT* fingerprintInfo);
struct fingerprintDeviceSTRUCT
{
DWORD dwSize;
HANDLE hDevice;
VOID* pDeviceInfo;
BOOL fIsListening;
BOOL fIsScanning;
HWND hwndTarget;
UINT nTargetMessageID;
BOOL (*GetImage) (VOID* pInfo, VOID* pBuffer, UINT* pnSize);
BOOL (*ChangeSetting) (VOID* pInfo,
UINT nID,
VOID* pValue,
UINT nValueSize);
};
What I need is the Vb structure of this C struct, and more
importantly, a way to convert any other structure - other than posting
all the header files and expecting someone to do it for me.
Something like:
Public Structure fingerprintDeviceSTRUCT
Dim dwSize As String
...
End Structure
Thank you.