usb connect disconnect problem

Discussion in 'C++' started by abhi, Jul 24, 2006.

  1. abhi

    abhi Guest

    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
     
    abhi, Jul 24, 2006
    #1
    1. Advertising

  2. abhi

    mlimber Guest

    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-lite/how-to-post.html#faq-5.9

    Cheers! --M
     
    mlimber, Jul 24, 2006
    #2
    1. Advertising

  3. abhi

    abhi Guest

    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-lite/how-to-post.html#faq-5.9
    >
    > Cheers! --M
     
    abhi, Jul 25, 2006
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. John Smith
    Replies:
    0
    Views:
    859
    John Smith
    Jan 2, 2006
  2. Tiwkiz
    Replies:
    0
    Views:
    455
    Tiwkiz
    Jan 30, 2007
  3. galapogos
    Replies:
    4
    Views:
    410
    Kenny McCormack
    May 11, 2007
  4. LittleAlex
    Replies:
    0
    Views:
    458
    LittleAlex
    Sep 15, 2008
  5. hazan

    Get network disconnect/connect event

    hazan, Dec 9, 2007, in forum: Javascript
    Replies:
    0
    Views:
    114
    hazan
    Dec 9, 2007
Loading...

Share This Page