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

Hybrid View

  1. #1
    Join Date
    Sep 2010
    Posts
    23

    Question Workerthread inside Oninitdialog

    I'd like to put a workerthread inside OnInidialog but I always get Debug Error when trying to execute the program. It compiles fine, only fails in debuggin and execution.
    The error message is something like

    Debug error - (title)
    blah blah... an unusual error occurs, the program has to stop.


    If I comment the workerthread out of the Oninitdialog, things become OK again

    Thank you
    Your smile's like a shining sun

  2. #2
    Join Date
    Aug 2000
    Location
    New York, NY, USA
    Posts
    5,656

    Re: Workerthread inside Oninitdialog

    Quote Originally Posted by SunnySmile View Post
    I'd like to put a workerthread inside OnInidialog but I always get Debug Error when trying to execute the program. It compiles fine, only fails in debuggin and execution.
    The error message is something like

    Debug error - (title)
    blah blah... an unusual error occurs, the program has to stop.


    If I comment the workerthread out of the Oninitdialog, things become OK again

    Thank you
    So what is your question?
    Obviously, there is something wrong either with you thread function or with the way you invoke it.
    Did that “blah blah” message (dialog, most likely) have a Retry button? So that you could go and debug that error?
    Vlad - MS MVP [2007 - 2012] - www.FeinSoftware.com
    Convenience and productivity tools for Microsoft Visual Studio:
    FeinWindows - replacement windows manager for Visual Studio, and more...

  3. #3
    Join Date
    Oct 2002
    Location
    Timisoara, Romania
    Posts
    14,360

    Re: Workerthread inside Oninitdialog

    Unless you show us the code is impossible to tell. Run in Debugger and when you get the assertion press Retry to go the source of the assertion.
    Marius Bancila
    Home Page
    My CodeGuru articles

    I do not offer technical support via PM or e-mail. Please use vbBulletin codes.

  4. #4
    Join Date
    Jul 2009
    Location
    India
    Posts
    835

    Re: Workerthread inside Oninitdialog

    As cilu said you should post your code first else we cant get understood whats happening.

    And check one thing, remove the thread calling function and check that the program still fails in OnInitDialog(). May be some other lines causing the error.
    ◄◄ hypheni ►►

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