Question about the libusb package

邱宥惠 <[email protected]>
Newsgroups gmane.comp.lib.libusb.devel.windows
Message-ID <CADDXLxvS+q_LhAztZq+D7WRZRR724Rcrx6nrOeTYv6iDnnh7tA@mail.gmail.com>
Dear :
         I am a user of libusb-win32-bin-1.2.6.0 package, it is a good
solution about the USB device, but I got some trouble in it.
My computer OS is wondows7 x86,and I used the package on Visual Studio 2010.
I used the package to get iManufacturer number of USB camera module. I can
get the number after install the inf-wizard.exe(I cannot get anything from
the USB, if without installing the inf-wizard.exe).
When I install the inf-wizard.exe, the USB camera module become a disk on
my computer, I cannot use the USB camera module as a camera, how can I do?

my c code show as follow:


#include "stdafx.h"
#include "lusb0_usb.h"
#include <string.h>
#include <stdio.h>
#include <Windows.h>


int main( )
{
struct usb_bus *bus;
struct usb_device *dev;

usb_init();
usb_find_busses();
usb_find_devices();

for (bus = usb_busses; bus; bus = bus->next)
{
for (dev = bus->devices; dev; dev = dev->next)
{
int ret;
char string[256];
usb_dev_handle *udev;
udev = usb_open(dev);

if (udev==NULL)
{
printf("can find device");
system("pause");
return -1;
}
if (udev)
{
if (dev->descriptor.iManufacturer)
{
ret = usb_get_string_simple(udev, dev->descriptor.iManufacturer, string,
sizeof(string));
if (ret > 0)
printf("Manufacturer : %s\n", string);
}

if (dev->descriptor.iProduct)
{
ret = usb_get_string_simple(udev, dev->descriptor.iProduct, string,
sizeof(string));
if (ret > 0)
printf("Product : %s\n", string);
system("pause");
}
 usb_close (udev);
}
}
}
system("pause");
return 0;

}

------------------------------------------------------------------------------
Open source business process management suite built on Java and Eclipse
Turn processes into business applications with Bonita BPM Community Edition
Quickly connect people, data, and systems into organized workflows
Winner of BOSSIE, CODIE, OW2 and Gartner awards
http://p.sf.net/sfu/Bonitasoft

_______________________________________________
Libusb-win32-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/libusb-win32-devel
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.