Click here to Skip to main content
13,052,342 members (54,967 online)
Rate this:
Please Sign up or sign in to vote.
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?
Posted 20-Apr-13 7:28am
Updated 20-Apr-13 7:52am
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.
Rate this: bad
Please Sign up or sign in to vote.

Solution 2

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.
Amin Ur Rehman 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
Rate this: bad
Please Sign up or sign in to vote.

Solution 1

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:
Rate this: bad
Please Sign up or sign in to vote.

Solution 3

Maybe problem In ID.maybe maybe.

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

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy | Mobile
Web02 | 2.8.170713.1 | Last Updated 24 Apr 2013
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100