Re: dont get the removecomplete message from the window XP.



Thanks for the reply.

My App is waiting for the DBT_DEVTYP_PORT-RemoveComplete ,
And AFAIK, I dont need to register for that notification.

Does OS send "WM_DEVICECHANGE-BROADCAST" Message by 'SendMessage'?
So If there is another process which is blocking some time,
My App can not get the BROADCAST Message?
Is My understanding about the BROADCAST Message is Correct?

If it is right, It seems not to be perfect way for recognizing
plugin/plugout of
the device.

Any suggestion will be appreciated.
Regards,
kiyo.


"Doron Holan [MS]" wrote:

are you registering for pnp notifications on the *file* handle that you open
as well?

d

--
Please do not send e-mail directly to this alias. this alias is for
newsgroup purposes only.
This posting is provided "AS IS" with no warranties, and confers no rights.


"ck" <ck@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:CA1EC189-5CC9-453D-9D98-4646E3EFEAE9@xxxxxxxxxxxxxxxx

Hello,
I'm working on WIN32 application which monitors and passes data from and
to
USB Device which also support serial communication .

I monitors device arrival/removal notification ( Serial Port ), by the
way,
especially
while I try to read data from USB device, if i remove usb device from PC,
I dont get the removecomplete message from Windows.

My process is the following.
1) Device Arrival ( Serial Port -DBT_DEVTYP_PORT)
2) Open Serial Port
3) Write/Read Serial Port
4) Close Serial Port
5) Open USB Device Port
6) Write/Read USB Device
7) if Read Failed, Close USB Device Handle
8) Device RemoveComplete ( Serial Port - DBT_DEVTYP_PORT ) ==> dont get
that
message .

The Device Driver Developer said to me that
He verified the following fact.
My app closes serial com port,
and closes USB Device port,
and Device Driver called WinAPI for Windows Event
iosetdeviceinterfacestate() to OS.
=> But My App or the other windows event collector(test program ) dont get
that messages.

After I kill My App, The RemoveComplete Event is notified.

Except closing opened port, what else should I do?
Any suggestion will be appreciated.

Regards,
kiyo,











.



Relevant Pages

  • Re: Reading Serial Port
    ... The problem with reading stale data is that if you have filled up the buffer with old ... every packet, which will help identify the packet sequences that are being lost. ... you program your test app to put data out at a rate ... I've successed to read correctly the serial port through a new ...
    (microsoft.public.vc.mfc)
  • Re: Serial port monitoring
    ... serial port and rather not change horses in mid stride. ... I would then have a loop that checks for char in serial buffer. ... Everything is done within my app. ... monitor a serial port from another app unless you install some kind ...
    (microsoft.public.vc.mfc)
  • Re: Serial port monitoring
    ... You are still thinking in terms of "check the serial buffer", and that is not what you ... All you want to do is read a character from a serial port. ... Everything is done within my app. ... monitor), but now ...
    (microsoft.public.vc.mfc)
  • Re: Serial port monitoring
    ... In the background I need to act upon any data that comes in the serial port. ... I would then have a loop that checks for char in serial buffer. ... Everything is done within my app. ... monitor a serial port from another app unless you install some kind ...
    (microsoft.public.vc.mfc)
  • Re: Application xxx has encountered a serious error and must shut
    ... Chris Tacke, Embedded MVP ... that - but I guess not - if the exception is from another managed thread ... stopped my Serial port thread - last time it stopped the whole app:-O. ...
    (microsoft.public.windowsce.app.development)