Importing SLABHIDtoUART.dll and SLABHIDDevice.dll to VB.net VS2010
01/06/2014 | 10:48 AM
Hi Silicon Lab Engineers,
I am Hafiz, developing an USB-UART application, using VB.net with Visual Studio 2010 with CP2110 hardware. I own two units of CP2110EK development boards.
I failed to import/include/add SLABHIDtoUART.dll and SLABHIDDevice.dll to my Software IDE.
I searched found nothing matched with this problem.
My PC specs; Intel Core i5-2310 @ 2.9 GHz 4 GB RAM 64-bit Windows OS, x64-based processor
Please anyone help me....
Thanks in advance.
Discussion Forums
Interface
Unanswered
The SLABHIDtoUART.dll is not a .NET assembly, but is a standard Windows DLL with a C API. You'll need to use platform invoke on the functions declared in the header file. In VB this is the 'Declare' statement and is part of the InteropServices.
From what the manual says we need both slabhidtouart.dll and slabhidDevice.dll
Can you please explain how you used the dlls. I am able to import the dll but when i call the apis for eg: HidUart_GetNumDevices executes successfully but doesnt return any value, Following is what I have done
Importing the DLL:
<DllImport("C:\Windows\SysWOW64\SLABHIDtoUART.dll", EntryPoint:="HidUart_GetNumDevices")> Private Shared Function HidUart_GetNumDevices(numDevices As Integer, vid As String, pid As String) As Integer End Function
Inside the form load:
Dim devCount As IntPtr = -1
MsgBox(HidUart_GetNumDevices(devCount, 0, pid))
This always returns 0 and devCount always remains -1
Kindly suggest. Thanks in Advance
Subbu
0
SLABHIDDevice.DLL has the underlying code to deal with an HID device generically. SLABHIDtoUART.DLL has the API you should use to access the CP2110, but it relied on SLABHIDDevice.DLL and they should exist together.
The HidUart_GetNumDevices() function will take either 0 for both VID and PID (to list all devices) - in your case you have supplied a PID in the pid variable (I assume it's non-zero) and 0 for the VID. It's probably not finding a device with VID of 0x0000. Instead specify 0 for both, or a specific VID and PID combination.
Importing SLABHIDtoUART.dll and SLABHIDDevice.dll to VB.net VS2010
Hi Silicon Lab Engineers,
I am Hafiz, developing an USB-UART application, using VB.net with Visual Studio 2010 with CP2110 hardware. I own two units of CP2110EK development boards.
I failed to import/include/add SLABHIDtoUART.dll and SLABHIDDevice.dll to my Software IDE.
I searched found nothing matched with this problem.
My PC specs;
Intel Core i5-2310 @ 2.9 GHz
4 GB RAM
64-bit Windows OS, x64-based processor
Please anyone help me....
Thanks in advance.
Here is a link that shows an example of how to do this:
http://msdn.microsoft.com/en-us/library/42b9ea93.aspx?cs-save-lang=1&cs-lang=vb#code-snippet-1
Hi Hafiz/ SLAB Engineers,
From what the manual says we need both slabhidtouart.dll and slabhidDevice.dll
Can you please explain how you used the dlls. I am able to import the dll but when i call the apis for eg: HidUart_GetNumDevices executes successfully but doesnt return any value, Following is what I have done
Importing the DLL:
<DllImport("C:\Windows\SysWOW64\SLABHIDtoUART.dll", EntryPoint:="HidUart_GetNumDevices")>
Private Shared Function HidUart_GetNumDevices(numDevices As Integer, vid As String, pid As String) As Integer
End Function
Inside the form load:
Dim devCount As IntPtr = -1
MsgBox(HidUart_GetNumDevices(devCount, 0, pid))
This always returns 0 and devCount always remains -1
Kindly suggest. Thanks in Advance
Subbu
SLABHIDDevice.DLL has the underlying code to deal with an HID device generically. SLABHIDtoUART.DLL has the API you should use to access the CP2110, but it relied on SLABHIDDevice.DLL and they should exist together.
The HidUart_GetNumDevices() function will take either 0 for both VID and PID (to list all devices) - in your case you have supplied a PID in the pid variable (I assume it's non-zero) and 0 for the VID. It's probably not finding a device with VID of 0x0000. Instead specify 0 for both, or a specific VID and PID combination.