12-10-2005 09:33 PM
12-11-2005 12:21 PM
Hi IB,
If I understand what you are describing properly, then I would recommend that you use a thread callback when your test executive thread completes its test. The thread callback can be run in the thread that started your GUI, which is most likely the same thread that scheduled the test executive thread. Thus you have better control over exiting the application or restarting the test executive thread if more testing is desired. I would probably put the serial number entry stuff in a popup before the test thread is even scheduled (so that the tests could still be canceled one last time before they begin). There are a couple of different approaches to pass the serial number into the test thread, if that is even truly a requirement for the test to run properly.
Look to CmtScheduleThreadPoolFunctionAdv(). You can typically use DEFAULT_THREAD_POOL_HANDLE for small applications unless the thread priorities for the test thread need to be adjusted. Specify a thread callback function, and get that setup, and then leave your event callback mask set to EVENT_TP_THREAD_FUNCTION_END and CmtGetCurrentThreadID() for the callback thread.
Good Luck,
Orlan
(Gig'em Aggies!)
12-11-2005
12:25 PM
- last edited on
07-01-2024
04:55 PM
by
Content Cleaner
Sincronizing execution betwenn more threads needs some special attentions to permit save execution to all of them (preparation, executin, stop and resource clearing and so on. I suggest you take a look to this document that explains with high detail all what's involved in developing multithreaded applications. Monitoring and Controlling Secondary Threads paragraph can be very helpful in your application.
As per serial number prompting, you could use PostDeferredCall function which posts a calls to a function into the main thread (the one into which the main function and ordinarily all the user interface is executed). Just for completeness, PostDeferredCallToThread posts a call to a function in a thread other from the main one.
12-12-2005 09:09 AM