Tech Support > Microsoft Windows > Drivers > RE: Detecting that a device isn't attached
RE: Detecting that a device isn't attached
Posted by Bryan S. Burgin [MSFT] on July 25th, 2003



Why not use the SetupDi APIs? Take a look at the DDK sample Devcon
(ddk\src\setup\devcon).

Bryan S. Burgin
bburgin@microsoft.com

This posting is provided "AS IS" with no warranties, and confers no rights.

Posted by Jerry West on July 25th, 2003


I'm using VB.....those APIs aren't available to me using VB, correct?

JW

""Bryan S. Burgin [MSFT]"" <bburgin@online.microsoft.com> wrote in message
news:r12eGAlUDHA.2144@cpmsftngxa06.phx.gbl...



Posted by Bryan S. Burgin [MSFT] on July 25th, 2003


If it could be done, you would have to craft your own .BAS file to declare
each function (using Declare Function Xxxx Lib "Yyyy.dll" Alias "Zzzz"
(..., ..., ...) As RetType), etc, and convert the necessary #defines to
Global Consts and structs to Types (and putting up with alignment issues,
if any).

This is also probably available via WMI, but I don't know WMI well enough
to offer any advice. You might seek out the WMI and/or VB forums.

Or you could use enough C from the necessary parts of the sample to return
what you want in a DLL and call that from VB.

Lastly, I just went to google and typed in "setupdi vb" and found several
hits, but didn't do any research of any of the hits -- I'll leave that to
you.

Good luck.

Bryan S. Burgin
bburgin@microsoft.com

This posting is provided "AS IS" with no warranties, and confers no rights.

Posted by Jerry West on July 25th, 2003


Thanks Bryan. Yes, the Google hits all refer to C code. I thought there was
a way to do it by parsing the registry as well.

JW


""Bryan S. Burgin [MSFT]"" <bburgin@online.microsoft.com> wrote in message
news:v9%23rPulUDHA.2096@cpmsftngxa06.phx.gbl...



Posted by Robert Marquardt on July 25th, 2003


Jerry West wrote:
Try posting a question in a VB newsgroup.
I am sure someone has already created the .BAS file already.
You only need some functions and structures.

I have done that work for Delphi (Pascal) successfully.


Posted by Doron Holan [MS] on July 25th, 2003


as a friendly warning, if your code needs to be portable from OS to OS and
SP to SP do *not* parse the registry yourself. the layout is completely
undocumented and heavily subject to change.

d

--
This posting is provided "AS IS" with no warranties, and confers no rights.
"Jerry West" <jw@comcast.net> wrote in message
news:vi1bpk4l6irh08@news.supernews.com...