Click to See Complete Forum and Search --> : DoModal()???


Lau Chi Pong
March 3rd, 1999, 02:58 AM
Hi All,


My application is in MDI style & has used CFormView as the base view class.

Also my application has created a thread beside the main thread. This thread is used to get information from

a hardware installed on the PC. The program will continuously listen to the hardware to find whether there is

any new message coming.


I have used a while loop to continuously getting message from the hardware.


I have tested the program in the English version of Win95 & 98......it works....message is continuously getting

from the hardware & I can press a button at the frame to popup a dialog by using the function DoModal().


However, when I used the same executable file in the Chinese verison of Win98...it cannot work. While getting

message from the hardware, the dialog cannot be popped-up at the same time. The dialog will only appear after

stopping getting message from the hardware.


What is the problem about this? Any comment about this?


Thanks a lot!!!

Benoît CHARDON
March 14th, 1999, 05:59 AM
Hello,


You say that you've try to run your application on a english version of Win9x and after on a chinese version. OK, but is it on same hardware ? I had made an application like yours to read barcode, it run fine with a PENTIUM PRO processor, but it hang on a PENTIUM... the problem was a while LOOP which hang the application when stopping the thread.


I hope it will help you

bye

eric33
April 22nd, 1999, 06:18 AM
A little note that could help.
It is a good pratice to give time to system in a back thread for example with sleep(0).
Try to avoid a thread with an infinite loop without giving time to others processes. It is a very poor programming method especially under windows.
I hope this could help.