From: Larry Serflaten on

"Ringo" <ringo.davis(a)gmail.com> wrote


> ProcessId = Shell(cmdline, Param)
> hProcess = OpenProcess(PROCESS_QUERY_INFORMATION, False, ProcessId)
> Do
> Call GetExitCodeProcess(hProcess, exitCode)
> DoEvents
> Loop While exitCode = STATUS_PENDING
>
> Any ideas on why this would stop the MS_comm stuff from working?

Instead of polling from a tight loop, have you tried using a timer?

LFS


From: J French on
On Sat, 18 Feb 2006 22:00:07 -0600, "Larry Serflaten"
<serflaten(a)usinternet.com> wrote:

>
>"Ringo" <ringo.davis(a)gmail.com> wrote
>
>
>> ProcessId = Shell(cmdline, Param)
>> hProcess = OpenProcess(PROCESS_QUERY_INFORMATION, False, ProcessId)
>> Do
>> Call GetExitCodeProcess(hProcess, exitCode)
>> DoEvents
>> Loop While exitCode = STATUS_PENDING
>>
>> Any ideas on why this would stop the MS_comm stuff from working?

>Instead of polling from a tight loop, have you tried using a timer?

Good point Larry

Ringo :-

I would enable a Timer but do nothing in its tick event
- just have it acting as a message pump

While exitCode = STATUS_PENDING
Call GetExitCodeProcess(hProcess, exitCode)
WaitMessage ' this yields until a msg comes in
DoEvents
Wend

If your Timer interval is about 250 then you'll get 4 messages a
second which will allow WaitMessage to return

It will of course, always return immediately when other messages come
in, but the App will be very efficient on CPU usage
- it is probably high CPU usage that is stuffing your COM port

First  |  Prev  | 
Pages: 1 2
Prev: Shutdown dialog Box
Next: Network Drive Not Ready