Re: How to PostThreadMessages?



It is essential that if you are using WinCE that you state so explicitly; there is no
reason to assume that this is what is being used, and the assumption is that unless you
explicitly state you are using WinCE that you are using a version of Windows no less
capable than Win2K, and more likely WinXP or even Vista.

However, the sad truth is that you still cannot put an infinite loop in a UI thread
because it merely cripples the key feature that make it a UI thread, that is, the message
pump. Once you have an infinite loop, you have no reason to have a UI thread. Once the
loop is entered, there can never be another message handled; not a timer message, not any
other message.

However, SetCommTimeouts seems to be a reasonable substitute for asynchronous I/O for
ReadFile. So ReadFile would essentiallly behave in a fashion consistent with asynchronous
I/O. Since my output thread would work well with synchronous output (except for the
shutdown issue), only a slight variation of that code would be required. The key here is
that you can't indefinitely block a UI thread. If, for example, a WriteFile wrote one
byte, with a timeout set by SetCommTimeouts, much of the effect of having asynchronous I/O
should be available, although a bit clumsier. So if the serial port got blocked for some
long period, the timeout would allow the ability to poll the shutdown boolean (rather than
using a shutdown event)

So this goes back to basic understanding issue of threading and asynchronous I/O, even if
the asynchronous I/O is performed by mechanisms somewhat more complex than
FILE_FLAG_OVERLAPPED.
joe

On Tue, 5 Jun 2007 13:29:09 -0500, "jp2code" <poojo.com/mail> wrote:

"Joseph M. Newcomer" wrote...
I fail to see why you cannot use asynchronous data transfer; there is no
reason this would
not work.

WinCE / PocketPC

Joseph M. Newcomer [MVP]
email: newcomer@xxxxxxxxxxxx
Web: http://www.flounder.com
MVP Tips: http://www.flounder.com/mvp_tips.htm
.



Relevant Pages

  • socket shutdown function
    ... shutdown() function in WinCE and Win32 are different. ... And if so, what's the reason? ...
    (microsoft.public.windowsce.app.development)
  • socket shutdown function
    ... shutdown() function in WinCE and Win32 are different. ... And if so, what's the reason? ...
    (microsoft.public.windowsce.app.development)
  • Re: NdisMediaStateDisconnected / NdisMediaStateConnected
    ... for some reason the WinCE started decreasing the systems memory 4k per ... second, and it was stuck in that position, until the cable was ...
    (microsoft.public.windowsce.platbuilder)
  • Re: To create 2 or more partitions from remainder Flash
    ... but I have not had reason to try it. ... two sets of registry entries with different start, ... > create 2 partitions from the remainder Flash during WinCE ...
    (microsoft.public.windowsce.embedded)
  • Re: Need a word
    ... >Some male aue-ers will understand the reason for your wince, ... >few from personal experience. ...
    (alt.usage.english)