Click here to Skip to main content
15,887,683 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
In the Release mode, my program runs fine, no major problems!

I am getting some runtime errors which are only occuring in the "Debug" configuration. The program compiles fine in Debug mode.

I see a message box ->


Debug Assertion Failed!

Program: <program name="">
File: winocc.cpp
Line: 330



Sequentially debugging, led me to this in doctempl.cpp

// create new from resource
if (!pFrame->LoadFrame(m_nIDResource,
        WS_OVERLAPPEDWINDOW | FWS_ADDTOTITLE,   // default frame styles
        NULL, &context))
{
    TRACE(traceAppMsg, 0, "Warning: CDocTemplate couldn't create a frame.\n");
    // frame will be deleted in PostNcDestroy cleanup
    return NULL;
}


This is where the assertion pops up.


In the linker, these are my additional library dependies. Is something wrong here?

d3d9.lib strmiids.lib ole32.lib winmm.lib psapi.lib user32.lib

Any idea what I am doing wrong?
Thanks.
Posted
Updated 20-Apr-13 7:52am
v2
Comments
Matthew Faithfull 20-Apr-13 16:33pm    
Is your application multithreaded?
Sergey Alexandrovich Kryukov 20-Apr-13 22:15pm    
Even though it cannot help you much at the moment, it's good to understand that such things as "Debug mode" or "Release mode" do not exist. "Debug" and "Release" are no more then configuration which can have any names. But the configurations are different. In one of the configurations, tracing can be is disabled.
—SA

Goto the code line where the ASSERT is raised. this maybe the BOOL CWnd::ShowWindow(int nCmdShow) function. Set a break point (F9) and run the program (debug). At the first hit or some else the window handle may be invalid. Check the call stack and avoid the call of ShowWindow with an invalid window handle.
Regards.
 
Share this answer
 
Comments
weirdProgrammer-2 25-Apr-13 8:29am    
it happens in my CMainFrame constructor actually :S nothing major happening there! But something is wrong, unable to narrow it down at the moment
delete all temp and build files and make a "rebuild all". Sometimes is an resource ID conflict the problem.

Or you must debug in the MFC-stuff :mad:
 
Share this answer
 
Maybe problem In ID.maybe maybe.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900