[OT] c equivalent of DoEvents or Application.ProcessMessages

Archive of the old Parsimony forum. Some messages couldn't be restored. Limitations: Search for authors does not work, Parsimony specific formats do not work, threaded view does not work properly. Posting is disabled.

[OT] c equivalent of DoEvents or Application.ProcessMessages

Postby Steve Maughan » 04 Mar 2004, 22:00

Geschrieben von: / Posted by: Steve Maughan at 04 March 2004 22:00:20:

The C version of Monarch is getting closer to playing real chess. Hopefully I'll have a new version within the next couple of weeks. Once question for our resident 'C' experts -
In VB when you need to pass control back to the application to allow it to process the message stack you use the DoEvents() command. Likewise in Delphi you would use Application.ProcessMessages. What should I use in 'C'? In developing using Visual Studio 2003. Is it just Sleep(0)? Is this appropriate or is there a better method?
Thanks,
Steve
Steve Maughan
 

Re: [OT] c equivalent of DoEvents or Application.ProcessMess

Postby Koundinya Veluri » 04 Mar 2004, 23:30

Geschrieben von: / Posted by: Koundinya Veluri at 04 March 2004 23:30:10:
Als Antwort auf: / In reply to: [OT] c equivalent of DoEvents or Application.ProcessMessages? geschrieben von: / posted by: Steve Maughan at 04 March 2004 22:00:20:
The C version of Monarch is getting closer to playing real chess. Hopefully I'll have a new version within the next couple of weeks. Once question for our resident 'C' experts -
In VB when you need to pass control back to the application to allow it to process the message stack you use the DoEvents() command. Likewise in Delphi you would use Application.ProcessMessages. What should I use in 'C'? In developing using Visual Studio 2003. Is it just Sleep(0)? Is this appropriate or is there a better method?
Thanks,
Steve
It depends on which library you're using. As far as I know, console programs don't receive messages so there's no need to call something like DoEvents(). If you're using .NET, you can use Application.DoEvents(). For MFC, it's a bit more complicated. Look up "idle loop processing" in the index.
Koundinya
Koundinya Veluri
 


Return to Archive (Old Parsimony Forum)

Who is online

Users browsing this forum: No registered users and 43 guests