Re: Snack, play sound: script behavior in C++ program diifers from the same running under Wish.



skulinetz@xxxxxxxxxxxxxxxxxx wrote:
...

Program is very short, so i also put here all code (OS Windows):
--------------------

...

for (string input;;)
{
getline (cin, input);
if (input == "p")
{
Tcl_Eval (i, "set play_state $play_pause");
}
else if (input == "s")
{
Tcl_Eval (i, "set play_state $play_stop");
}
else if (input == "q")
{
cout << "waiting thread... " << endl;
WaitForSingleObject (thread, INFINITE);
CloseHandle (thread);
break;
}
}

Tcl_Finalize ();
}


Wait a sec here... You aren't running the event loop!? See Tk_Main and
Tk_MainLoop in the Tk source to understand why you need to.

--
Reality continues to ruin my life.
-- Calvin

Attachment: signature.asc
Description: OpenPGP digital signature



Relevant Pages

  • Re: threading question: is this code going to work perfectly?
    ... WaitForSingleObject(). ... while (t1count++ < looplimit) ... SignalObjectAndWait(thread2wait, thread1wait, INFINITE, FALSE); ... while (t2count++ < looplimit) ...
    (microsoft.public.dotnet.languages.vc)
  • Re: threading question: is this code going to work perfectly?
    ... it resumes the second thread by calling SetEvent and itself goes into wait condition by calling WaitForSingleObject(). ... while (t1count++ < looplimit) ... SignalObjectAndWait(thread2wait, thread1wait, INFINITE, FALSE); ... while (t2count++ < looplimit) ...
    (microsoft.public.dotnet.languages.vc)
  • Re: Prorgram to launch cemgrc.exe
    ... In my case, I can configure multiple target desktop machines, so I'm using ... > WaitForSingleObject(pi.hProcess, INFINITE); ... >> Paul Tobey did a nice writeup for how to ...
    (microsoft.public.windowsce.platbuilder)
  • Re: help closing handle of thread
    ... There is no need to wait until the thread exits. ... You can CloseHandle as soon as you have no need for the handle - even immediately after creating the thread. ... But I can't use WaitForSingleObject, since it will make my thread act synchronously, so that the main thread will stop executing until the thread finishes. ... How would I close the handle of the thread without waiting for it to finish? ...
    (microsoft.public.vc.mfc)
  • Re: Problems with CreateThread and WaitForSingleObject.
    ... Funnily if I do a Sleepbefore my CloseHandle() ... SetEvent(globalevent); ... >> The problem is that my WaitForSingleObject is timedout and only after ... In my thread function I ...
    (microsoft.public.pocketpc.developer)