Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Help with Parameter Passed to Win32 API
Message
From
10/10/2006 21:57:00
 
 
To
10/10/2006 20:52:36
General information
Forum:
Visual FoxPro
Category:
Windows API functions
Environment versions
Visual FoxPro:
VFP 9
OS:
Windows XP SP2
Network:
Windows 2003 Server
Database:
MS SQL Server
Miscellaneous
Thread ID:
01160965
Message ID:
01161081
Views:
18
Thanks for the ideas Herman. My goal is to write/read from the USB device. Whatever it takes to get there is what I'll have to do. I was hoping to do something like the list below:

1. Call SetupDiGetClassDevs(interface_guid, 0, 0, DIGCF_PRESENT | DIGCF_DEVICEINTERFACE) to get a list of devices.
2. Call SetupDiEnumDeviceInterfaces() to get a list of available device interfaces.
Call SetupDiGetDeviceInterfaceDetail() to fetch information for the actual device interface we are going to use.
3. Use the DevicePath member of the PSP_DEVICE_INTERFACE_DETAIL_DATA structure returned by the SetupDiGetDeviceInterfaceDetail() call as the devicename/filename in the CreateFile() call.
4. Call WriteFile() repeatedly to send data to the device.
5. Call CloseHandle() to close the device

or:

Use SetupDiGetInterfaceDeviceDetail,
port number from original guid, get handle to it (passing
device name to createfile(), use closehandle to close device,
use deviceiocontrol() generate a CTL_CODE, make command packet,
send using deviceiocontrol() send TXPacket and read from RXPacket

The device is a mobile USB printer which includes a card swipe for drivers licenses. I can write/read from it via Bluetooth (when a virtual com port is created). I now need to do the same via USB. At first I was hoping it was a HID but its not so my only real choice (that I know of so far in my research) is using setupapi. By all appearances it should be possible...

Here is the link I was going by:
http://windowssdk.msdn.microsoft.com/en-us/library/ms681232.aspx




>>Thanks Herman, I sent you one more code example to test to verify this for me. I am seeing those same results you mention in WinXP. I can pull the data from the registry (where the GUID is irrelant using SetupDiGetDeviceRegistryProperty()) but not using SetupDiEnumDeviceInterfaces() in WinXP - only for HID Devices.
>>
>>I REALLY was hoping that was not the case :0(
>>
>
>Tracy,
>
>Yup, the results is the same.
>
>Well, I think this will be really hard :-(
>I read some more from Windows DDK, the GUID_DEVCLASS_xxx is not a DEVICE INTERFACE CLASS, but a DEVICE SETUP CLASS. I think you have to create your own device driver to expose the Device Interface (you must have a DDK for this). I never make a Driver to Interface, so that things is beyond my knowledge.
>
>One more thing, maybe you can try to create device interface by using SetupDiCreateDeviceInfoList(). For more info search for that function at MSDN.
>
>Just for my curiousity, are you really need SetupDiEnumDeviceInterfaces() to make it work?
>
>Good luck!
.·*´¨)
.·`TCH
(..·*

010000110101001101101000011000010111001001110000010011110111001001000010011101010111001101110100
"When the debate is lost, slander becomes the tool of the loser." - Socrates
Vita contingit, Vive cum eo. (Life Happens, Live With it.)
"Life is not measured by the number of breaths we take, but by the moments that take our breath away." -- author unknown
"De omnibus dubitandum"
Previous
Reply
Map
View

Click here to load this message in the networking platform