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 |
visual Pogramming c++ coding for create a paint application.. (Please someone help me)
what is the use of AFX_MANAGE_STATE ?
What are the types of button controls?
How do you change the properties for a tree view control that is part of the CTreeView class?
Explain about MDI and CMultiDocTemplate ?
Hi All, I have created one MFC Dialog Based application.now if i am running the application its working fine,instead of closing he application i minimized the application,if i run the application again,i am getting the Dialog. I want to prevent the calling of application multiple times. please give me the code and let me know in which method i need to make changes. Praveer
How to setup a timer?
In SDI how many view's are attached to document object and in MDI how many view's are attached to Document object?
How can we create thread in MFC framework?
How to handle dynamic menus in MFC?
1)dynamic creation of a Button ?
What is #progma and where it is used?