What is the difference between the ASSERT and VERIFY macros?
Answers were Sorted based on User's Feedback
Answer / muthukumar. j
Both ASSERT and VERIFY macros behave in the same Manner in
debug Version.
But in Release version the Expression in the ASSERT is
ignored. And in Release version the Expression in the
VERIFY is evaluated. But not verified. Means the expression
is evaluated. And like dubug it is NOT stop the execution
if the expression evaluated to FALSE.
| Is This Answer Correct ? | 16 Yes | 0 No |
ASSERT:-
--------
This function is available only in the Debug version of MFC.
Ctharam* tharamage = new Ctharam(21); //Ctharam is derived from CObject.
ASSERT(tharamage != NULL);
ASSERT(tharamage ->IsKindOf(RUNTIME_CLASS(Ctharam)));
// Terminates program only if tharamage is NOT a Ctharam*.
VERIFY:-
-------
1)
In the Debug version of MFC, evaluates its argument.
ex:- VERIFY(booleanExpression )
2)
In the Release version of MFC, VERIFY evaluates the expression
Ex:-
// get the display device context
HDC hdc;
VERIFY((hdc = ::GetDC(hwnd)) != NULL);
// give the display context back
::ReleaseDC(hwnd, hdc);
| Is This Answer Correct ? | 1 Yes | 0 No |
Answer / satyabrata mishra
ASSERT() macro works in the Debug builds
VERIFY() macro works in Release builds.
| Is This Answer Correct ? | 2 Yes | 10 No |
How to handle dynamic menus in mfc? What happens when client calls cocreateinstance?
Can you explaing the relashionship between document,frame and view ?
Does the application have more than one object? If Yes, Briefly explain.
1)How to load an icon on a button as Dynamically ?
What is userdefine Messages in MFC?
How we call a dialog in another dialog?
what are the feauters of CObject
1)set the Title for The File DialogBox, in MFC?
What is the difference between GetMessage and PeekMessage ?
I want recent paper pattern for HP company?
1)To Remove WS_MINIMIZEBOX in a Frame ?
What is the difference between Struts and JSF? Pls list some most suitable differences.