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 does the UIThread and worker thread communicates and handle events
what is the use of CWinApp class?
what are the feauters of CObject
What function is called by a document class to notify views that the document has been changed?
1)How to change the size of a button at run time ?
If there is more than 100 control in a window how we can change the Taborder of a controls
What is the difference between workrer thread and UI thread
1)How to load an icon on a button as Dynamically ?
Tell me the work of HTREDUCE and HTZOOM
What is primitive and non-primitive application?
How to convert a CString variable to char* or LPTSTR?
19)how to set Back Ground Picture to a Dialog Box in MFC ?