CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3

Thread: DoModal()???

  1. #1
    Join Date
    Apr 1999
    Posts
    1

    DoModal()???



    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!!!




  2. #2
    Join Date
    Mar 1999
    Posts
    3

    Re: DoModal()???



    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

  3. #3
    Join Date
    May 1999
    Posts
    318

    Re: DoModal()???

    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.



Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured