Detecting an attached IFK under COM

Legacy support with Phidget21
Jim Mack
Fresh meat
Posts: 3
Joined: Mon Sep 02, 2013 6:26 pm

Detecting an attached IFK under COM

Postby Jim Mack » Wed Sep 04, 2013 12:35 pm

In a VB6 application using the COM dll, I need to detect on startup whether an module is attached to the USB port. I've tried this using WithEvents and without, no difference

It seems obvious that the .IsAttached property would provide this information, but it doesn't. I notice in the examples that uses of this property during Form_Load etc are commented out, and indeed when they're uncommented, fail to work (.IsAttached is always false, etc).

The same seems to be true of other properties that would be helpful, like .SerialNumber etc. They only seem to function if read in the _OnAttach event.

The problem is that if no module is attached on startup (or if WithEvents isn't used), no _OnAttach event occurs and so there's no way to detect an unconnected module.

What am I missing?

Return to “VB 6.0”

Who is online

Users browsing this forum: No registered users and 1 guest