473,434 Members | 1,430 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,434 software developers and data experts.

usb connect disconnect problem

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

Jul 24 '06 #1
2 2979
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

Jul 24 '06 #2
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
Jul 25 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Amir | last post by:
Hi, According to Application Programming and SQL Guide chapter 29: "If DB2 terminates, a task that issued CONNECT must issue DISCONNECT to reset the CAF control blocks. The function returns...
4
by: banz | last post by:
Hello I have a problem to resolve: I wrote a Perlscript which caches data from a server (local on my machine) I would like to have a other connection to a remote server but I don't know how to...
6
by: yoyo | last post by:
Mabey I'm missing something very basic, but I can't seem to get it to work. I'm trying to follow along in the sample programs that tells how to do that, but mine still doesn't work. In my...
2
by: yyy | last post by:
Hello, Can someone please tell me how I can connect to the Internet and/or disconnect from it using C#.NET ? I just want to open this window in order to connect:...
2
by: http://www.visual-basic-data-mining.net/forum | last post by:
Say i have declare a module for connection and two buttons... one button has the method connect() and the other has the method disconnect().... how do i actually connect after i had disconnect...
2
by: dan kisting | last post by:
Hi, I wrote a chat program and it uses Sockets to connect. There is no intentional port scan going on, however I am seeing tons of port scans on that port in our firewall, and it (the firewall)...
1
by: Maximus | last post by:
hi all, I want to kow if there is a way to connet a machine using a VPN client through vb.net or c# code. I have requirement where i need to copy file using VPN. Hence, I need to start the...
3
by: Laurence | last post by:
Hi there, Does anyone know what's difference among "connect reset", "disconnect", and "terminate"? Thanks in advance,
13
by: trymore | last post by:
Hi all, can anybody help me out there? I am developing a client sockect to send transactions form a DB to a server socket. the way i want is to connect, send, recieve , disconnect, connect, send,...
3
by: jc | last post by:
Hi there: Reading from internet i found that the best way to use a database is to connect and disconnect on every single database request, so if you are loading a listbox manually from a...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.