[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

A great challenge with the USB ports and devices

Posted on 2006-11-01
7
Medium Priority
?
156 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

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

There are many ways to remove duplicate entries in an SQL or Access database. Most make you temporarily insert an ID field, make a temp table and copy data back and forth, and/or are slow. Here is an easy way in VB6 using ADO to remove duplicate row…
Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…
Suggested Courses

649 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