Unfortunatelly this doesn't work. I also tried
ClearCommError but that always report zero for
nonoverlapped writing. Since PocketPC doesn't support
overlapped writing this has no use.
Bostjan
>-----Original Message-----
>You might try using the SetCommEvent() and WaitCommEvent
() APIs (see MSDN)
>to wait for the EV_TXEMPTY event. Though I've never used
this on a virtual
>COM port as you are, the event is supposed to be signaled
once all data in
>the output buffer is sent.
>code something like this:
>// open port hPort
>SetCommMask(hPort, EV_TXEMTPY);
>// send your data
>// replace your Sleep() statement with this:
>DWORD mask;
>WaitCommEvent(hPort, &mask, NULL);
>CloseHandle(hPort);
>> Hi!
>> I'm using iPAQ 3870 and Winconnect bluetooth print
adapter
>> for wireless printing. I print to virtual COM port 8
with
>> one problem. If I close the port immediately after
>> successful WriteFile, nothing is printed. Sleeping
for "a
>> while" before CloseHandle helps, but that is not good
>> solution. FlushFileBuffers doesn't help either. I
suppose
>> driver should take the care that port isn't closed until
>> all data is sended but this obviously is not the case.
>> What can I do to make printing reliable?
>> Thanks,
>> Bostjan
>.