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