Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > C++ > usb connect disconnect problem

Reply
Thread Tools

usb connect disconnect problem

 
 
abhi
Guest
Posts: n/a
 
      07-24-2006
Hi,

I have an application for usb mass storage devices, which listens to
the WM_DEVICECHANGE notification and upon receiving DBT_DEVICEARRIVAL
does some processing and then soft eject the usb device thru
IOCTL_STORAGE_EJECT_MEDIA command.

I am observing that when the device is ejected at the same time the
explorer is trying to open the default window for the mass storage
device and hence I am gettting an error saying "drive letter:\\ is
inaccessible". Can someone give me an idea as to how to resolve this.
Also observed that the issue is resolved if I keep a delay of around
500 milliseconds before ejecting the device but I do not want to use
Sleep(...). I am working on Windows XP.

Thanks in advance.
Abhi

 
Reply With Quote
 
 
 
 
mlimber
Guest
Posts: n/a
 
      07-24-2006
abhi wrote:
> I have an application for usb mass storage devices, which listens to
> the WM_DEVICECHANGE notification and upon receiving DBT_DEVICEARRIVAL
> does some processing and then soft eject the usb device thru
> IOCTL_STORAGE_EJECT_MEDIA command.
>
> I am observing that when the device is ejected at the same time the
> explorer is trying to open the default window for the mass storage
> device and hence I am gettting an error saying "drive letter:\\ is
> inaccessible". Can someone give me an idea as to how to resolve this.
> Also observed that the issue is resolved if I keep a delay of around
> 500 milliseconds before ejecting the device but I do not want to use
> Sleep(...). I am working on Windows XP.


This is not a C++ language question (the topic of this group) but a
platform-specific question. Please see this FAQ for what is on-topic
here and for a list of ther places you might try:

http://www.parashift.com/c++-faq-lit...t.html#faq-5.9

Cheers! --M

 
Reply With Quote
 
 
 
 
abhi
Guest
Posts: n/a
 
      07-25-2006
sorry for the inconvinience cause by me and thanks for the info.

mlimber wrote:
> abhi wrote:
> > I have an application for usb mass storage devices, which listens to
> > the WM_DEVICECHANGE notification and upon receiving DBT_DEVICEARRIVAL
> > does some processing and then soft eject the usb device thru
> > IOCTL_STORAGE_EJECT_MEDIA command.
> >
> > I am observing that when the device is ejected at the same time the
> > explorer is trying to open the default window for the mass storage
> > device and hence I am gettting an error saying "drive letter:\\ is
> > inaccessible". Can someone give me an idea as to how to resolve this.
> > Also observed that the issue is resolved if I keep a delay of around
> > 500 milliseconds before ejecting the device but I do not want to use
> > Sleep(...). I am working on Windows XP.

>
> This is not a C++ language question (the topic of this group) but a
> platform-specific question. Please see this FAQ for what is on-topic
> here and for a list of ther places you might try:
>
> http://www.parashift.com/c++-faq-lit...t.html#faq-5.9
>
> Cheers! --M


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Get network disconnect/connect event hazan Javascript 0 12-09-2007 03:55 PM
CVS disconnect and connect another repository from Netbeans Tiwkiz Java 0 01-30-2007 04:37 PM
Repeatedly Disconnect and Connect =?Utf-8?B?cGF0aWxw?= Wireless Networking 0 02-18-2005 03:17 PM
frequent disconnect - connect???? HELP Frank Esposito Computer Support 7 06-19-2004 12:13 AM
Basic ethernet question - Is it safe to connect/disconnect 10/100BaseT cables with computers and/or hub ON? Roger© Computer Support 18 10-06-2003 02:09 AM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57