?
Solved

A great challenge with the USB ports and devices

Posted on 2006-11-01
7
Medium Priority
?
153 Views
Last Modified: 2010-04-30

I`m need to create an aplication in visual basic 6.0, that could monitor USB devices a projector a smart board, APC,Printer all on the USB Port, the big problem is to detect via USB the name and manufacter of the device. Also I need to establish a comunication with these hardware like asking the projector how many hours has been on line and the life status of the lamp bolt.

In the printer I have to ask similar questions like how much ink is left on the cartridge or time left to be with out ink.

I really try several windows dll like msinfo32 or kernel32 but the only think a receive is a serial number of the device nothing more.

This is really urgent for my enterprise

This will meant a lot for me and my boss
0
Comment
Question by:pedro_arzac
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
7 Comments
 
LVL 76

Assisted Solution

by:GrahamSkan
GrahamSkan earned 200 total points
ID: 17853381
I think that you are looking for some kind of magic.

For some classes of device, such as printers, their drivers can give a standard set of answers, such as selected tray. However, these definitions differ considerably, so you need a knowledge of each driver, and how to communicate with it.

You can tell this from the utilities that the device manufactureres provide.
 
For other devices, there is nothing approaching ther interface that you are expecting.  For instance, as far as I know, most projecter devices do not provide the digital data, or a means to interrogate the lamp life.

0
 
LVL 15

Accepted Solution

by:
JackOfPH earned 800 total points
ID: 17854500
0
 
LVL 15

Assisted Solution

by:JackOfPH
JackOfPH earned 800 total points
ID: 17854506
Dim obj, objs, buf

Set objs = GetObject("winmgmts:").InstancesOf("Win32_DiskDrive")
For Each obj In objs
     If obj.InterfaceType = "USB" Then
          buf = "Model: " & obj.Model & vbCr
          buf = buf & "PnP Device ID: " & obj.Manufacturer
          MsgBox (buf)
     End If
Next
0
 

Author Comment

by:pedro_arzac
ID: 17867430

Hi JackOFPH I have use your code but it doesn`t work for me Because it only detects the logical Disks, but the devices like a printer, or projector or any other device detect and adopted by the Windows OS is not seen like a logial drive.

I will accept any other suggestion?
0
 

Author Comment

by:pedro_arzac
ID: 17867759

Hi GrahamSkan you`re right I really need some magic code.

My real problem is that I`t was supposed that my client will give me tha API for the devices to monitoring them, but In the last moment they order me to create the API so, I need to stablish the communication with the USB devices, I have the utility programs that came with the devices but I don`t know how to extract information from them.

The main problem is that first I need to identify the devices connected to the machine, the devices not the logical disks this is rough and then communicate with them .

I accept Any suggestions
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction While answering a recent question (http://www.experts-exchange.com/Q_27402310.html) in the VB classic zone, I wrote some VB code in the (Office) VBA environment, rather than fire up my older PC.  I didn't post completely correct code o…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
Suggested Courses
Course of the Month9 days, 13 hours left to enroll

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question