vc++ debug assertion error

help :\

Debug Assertion Failed!

Program: ...\DAPP\DEBUG\DAPP.EXE
File: appcore.cpp
Line: 85

&

Program: ...\DAPP\DEBUG\DAPP.EXE
File: appcore.cpp
Line: 92

any thoughts?

-mare mortis

(oops, didn't mean to post this here, still need help though)
maremortisAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

fl0ydCommented:
Just what it says: An assumption that was made wasn't met. Check lines 85 and 92 of appcore.cpp and you have all the information you need to fix the problem.

.f
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
maremortisAuthor Commented:
The cause wasn't in any of my code..it was something the mfc dll appwizard (which i won't use again) was throwing in there, points for being the only one to try and help me :)

-mare mortis
0
fl0ydCommented:
Sorry to say that, but the fault is most likely not on the part of the appwizard's code. The asserts are there to ensure, that you are using the framework properly. If you get a debug-assertion, you are making a mistake, not the framework that's telling you about it. Let's assume you have a line of code that reads like this (taken from CWnd::Attach):

ASSERT( m_hWnd == NULL );

it makes sure that you can only attach a 'fresh', i.e. unused CWnd object to an existing window. The MFC is an extremely complex framework. To make it safe it is plastered with assertions to ensure proper use.

To illustrate the use of ASSERT here is a more basic example of how it works. Let's say you are writing a function that operates on a CWnd object:

void SafeShowWindow( CWnd* pWnd ) {
    // ensure that you do not accidentally pass a NULL-pointer
    ASSERT( pWnd != NULL );
    pWnd->ShowWindow( SW_SHOW );
}

If you now attempt to call SafeShowWindow( NULL ); you will get a dialog during a debug session stating the file and line number where something went wrong. You can now go the the call stack window and find out where it was called from and fix the problem, before the application just crashes when compiled in release mode.

One more note: assertions will only be compiled in debug builds -- they do not exist in release builds anymore and therefore don't present a performance issue. They are of great help during debugging, especially the MFC-ASSERT macro that gives you a lot more information (especially file name and line number) than the C Run-Time Library's assert-function. Use it whenever you want to be rather safe than sorry. And don't get mad at the appwizard when it tells you that your application has logical errors.

I hope that made it a bit more clear, what exactly the problem is you are facing.

.f
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Programming

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.