Click here to Skip to main content
16,011,647 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: search specified string in text Pin
Rajesh R Subramanian7-Jan-07 19:41
professionalRajesh R Subramanian7-Jan-07 19:41 
JokeRe: search specified string in text Pin
sdhtyjnniutnbjnhbghb7-Jan-07 19:53
sdhtyjnniutnbjnhbghb7-Jan-07 19:53 
GeneralRe: search specified string in text Pin
Hamid_RT7-Jan-07 20:01
Hamid_RT7-Jan-07 20:01 
QuestionInternationallization of Software Pin
Atul237-Jan-07 18:01
Atul237-Jan-07 18:01 
AnswerRe: Internationallization of Software Pin
Michael Dunn7-Jan-07 18:43
sitebuilderMichael Dunn7-Jan-07 18:43 
QuestionCDocTemplate Constructor Asserts Pin
#realJSOP7-Jan-07 11:21
professional#realJSOP7-Jan-07 11:21 
AnswerRe: CDocTemplate Constructor Asserts Pin
PJ Arends7-Jan-07 12:18
professionalPJ Arends7-Jan-07 12:18 
GeneralRe: CDocTemplate Constructor Asserts Pin
#realJSOP7-Jan-07 13:55
professional#realJSOP7-Jan-07 13:55 
It's a nothing-fancy MFC SDI app. The only thing I changed in the CDocTemplate was the view class.

What's really stupid is I've done this before, and I can't think of anything I'm forgetting.

The trace through IsDerivedFrom doesn't make any sense. It's comparing pointers to objects instead of doing something like checking the results of a dynamic_cast to the desired base class. Here's that function - the bold parts are the lines executed:

BOOL CRuntimeClass::IsDerivedFrom(const CRuntimeClass* pBaseClass) const
{
	ENSURE(this != NULL);
	ASSERT(AfxIsValidAddress(this, sizeof(CRuntimeClass), FALSE));
	ENSURE(pBaseClass != NULL);
	ASSERT(AfxIsValidAddress(pBaseClass, sizeof(CRuntimeClass), FALSE));

	// simple SI case
	const CRuntimeClass* pClassThis = this;
#ifdef _AFXDLL
	for ( ; ; )
#else
	while (pClassThis != NULL)
#endif
	{
		if (pClassThis == pBaseClass)
			return TRUE;
#ifdef _AFXDLL
		if (pClassThis->m_pfnGetBaseClass == NULL)
			break;
		pClassThis = (*pClassThis->m_pfnGetBaseClass)();
#else
		pClassThis = pClassThis->m_pBaseClass;
#endif
	}
	return FALSE;       // walked to the top, no match
}


If checks the following classes:

CTestGridView3
CView <------------ !!!!!
CCmdTarget
CObject
NULL





"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997
-----
"...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001


GeneralRe: CDocTemplate Constructor Asserts Pin
#realJSOP7-Jan-07 14:24
professional#realJSOP7-Jan-07 14:24 
GeneralRe: CDocTemplate Constructor Asserts Pin
PJ Arends7-Jan-07 14:55
professionalPJ Arends7-Jan-07 14:55 
GeneralRe: CDocTemplate Constructor Asserts Pin
Michael Dunn7-Jan-07 18:48
sitebuilderMichael Dunn7-Jan-07 18:48 
GeneralRe: CDocTemplate Constructor Asserts Pin
#realJSOP7-Jan-07 23:25
professional#realJSOP7-Jan-07 23:25 
QuestionDetecting doubleclick on a desktop window - part 2. Pin
PatrykDabrowski7-Jan-07 10:43
PatrykDabrowski7-Jan-07 10:43 
AnswerRe: Detecting doubleclick on a desktop window - part 2. Pin
PatrykDabrowski7-Jan-07 12:03
PatrykDabrowski7-Jan-07 12:03 
AnswerRe: Detecting doubleclick on a desktop window - part 2 - solution? Pin
PatrykDabrowski7-Jan-07 16:37
PatrykDabrowski7-Jan-07 16:37 
AnswerRe: Detecting doubleclick on a desktop window - part 2. Pin
Naveen7-Jan-07 16:55
Naveen7-Jan-07 16:55 
QuestionMultithreading? Help! Pin
Yonggoo7-Jan-07 8:37
Yonggoo7-Jan-07 8:37 
AnswerRe: Multithreading? Help! Pin
PJ Arends7-Jan-07 9:12
professionalPJ Arends7-Jan-07 9:12 
QuestionUsing Resource ID's [modified] Pin
BlitzPackage7-Jan-07 7:45
BlitzPackage7-Jan-07 7:45 
AnswerRe: Using Resource ID's Pin
PJ Arends7-Jan-07 9:13
professionalPJ Arends7-Jan-07 9:13 
GeneralRe: Using Resource ID's Pin
BlitzPackage7-Jan-07 10:01
BlitzPackage7-Jan-07 10:01 
Questionhooking a function Pin
shaderx7-Jan-07 6:59
shaderx7-Jan-07 6:59 
AnswerRe: hooking a function Pin
Dominik Reichl7-Jan-07 7:48
Dominik Reichl7-Jan-07 7:48 
Questionsign bit Pin
ikbahrian7-Jan-07 5:00
ikbahrian7-Jan-07 5:00 
AnswerYes. Pin
CPallini7-Jan-07 5:28
mveCPallini7-Jan-07 5:28 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.