CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 6 of 6
  1. #1
    Join Date
    Apr 1999
    Posts
    51

    App crashing on exit in release mode not in debug



    My application is crashing when it executes in release mode but does fine in debug. I am using a thread for reading the serial port, but in AppExit I check for and kill the thread if it exists. What else would cause this? Is there any way to figure out where this is occurring by debugging the running release mode application?


    Thanks,


    Steve

  2. #2
    Join Date
    Apr 1999
    Posts
    51

    Re: App crashing on exit in release mode not in debug



    After further testing, it turns out to be a call to GetWindowPlacement(). The code is as follows:

    CAWIMSApp* pApp = (CAWIMSApp*)AfxGetApp();

    WINDOWPLACEMENT *wndpl;

    pApp->m_pMainWnd->GetWindowPlacement(wndpl);

    AfxMessageBox("Finished GetWindowPlacement"

    pApp->WriteProfileInt("AWIMS Client","Maximized",pApp->m_pMainWnd->IsZoomed());

    pApp->WriteProfileInt("AWIMS Client","Minimized",pApp->m_pMainWnd->IsIconic());

    pApp->WriteProfileInt("AWIMS Client","Left",wndpl->rcNormalPosition.left);

    pApp->WriteProfileInt("AWIMS Client","Right",wndpl->rcNormalPosition.right);

    pApp->WriteProfileInt("AWIMS Client","Top",wndpl->rcNormalPosition.top);

    pApp->WriteProfileInt("AWIMS Client","Bottom",wndpl->rcNormalPosition.bottom);





  3. #3
    Join Date
    Apr 1999
    Posts
    51

    Re: App crashing on exit in release mode not in debug



    Ok, I was reading my post looking at my code snippet, I noticed that I did not allocated memory for the wndpl variable. Oops! Nevermind!!!!

  4. #4
    Join Date
    Apr 1999
    Posts
    51

    Re: App crashing on exit in release mode not in debug



    Ok, now that I fixed that problem, I am still have the original crash. This time it occurs when I call exit(0); Any ideas?

  5. #5
    Join Date
    May 1999
    Location
    Sydney, Australia
    Posts
    420

    Re: App crashing on exit in release mode not in debug



    Don't acll exit(0) from a windows app

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