Click here to Skip to main content
15,914,413 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Get text from the focused control in another window Pin
David Crow23-Jan-09 6:21
David Crow23-Jan-09 6:21 
GeneralRe: Get text from the focused control in another window Pin
nc3b23-Jan-09 6:24
nc3b23-Jan-09 6:24 
GeneralRe: Get text from the focused control in another window Pin
Rajkumar R23-Jan-09 8:08
Rajkumar R23-Jan-09 8:08 
GeneralRe: Get text from the focused control in another window Pin
nc3b23-Jan-09 8:10
nc3b23-Jan-09 8:10 
AnswerRe: Get text from the focused control in another window Pin
Code-o-mat23-Jan-09 6:12
Code-o-mat23-Jan-09 6:12 
QuestionTemplate parameter interpreted as base, not derived Pin
Member 260377223-Jan-09 4:59
Member 260377223-Jan-09 4:59 
AnswerRe: Template parameter interpreted as base, not derived Pin
Stuart Dootson23-Jan-09 6:40
professionalStuart Dootson23-Jan-09 6:40 
GeneralRe: Template parameter interpreted as base, not derived Pin
Member 260377223-Jan-09 7:12
Member 260377223-Jan-09 7:12 
Thanks for the response. Your output is what I expected. I was looking at the pointer types in the debugger, not printing out the type info to the console. The print statements give me what you got. I am using VS2008 v9 SP1. I was performing the wrong check to get a type match. I changed the function to the following:

template<class T> bool CheckType(boost::shared_ptr<Base> pBase)
{
	Base* pBaseRaw = pBase.get();
        if(pBaseRaw == null)
        {
                return false;
        }

	if(typeid(*pBaseRaw) == typeid(T)) //Now dereferencing pBaseRaw. Bad idea?
	{
		return true;
	}

	return false;
}


I am now dereferencing the base class pointer returned from shared_ptr which casts it to the right type. I believe this is a sketchy implicit cast to the derived type. Should I just dynamic_cast or does the typeid comparison take care of type issues?

ThanksThumbs Up | :thumbsup:
GeneralRe: Template parameter interpreted as base, not derived Pin
Stuart Dootson23-Jan-09 8:16
professionalStuart Dootson23-Jan-09 8:16 
AnswerRe: Template parameter interpreted as base, not derived [modified] Pin
Rajkumar R23-Jan-09 7:02
Rajkumar R23-Jan-09 7:02 
GeneralRe: Template parameter interpreted as base, not derived Pin
Member 260377223-Jan-09 7:14
Member 260377223-Jan-09 7:14 
QuestionCMFCMenuBar menu manipulation problem. Pin
oleg6323-Jan-09 4:39
professionaloleg6323-Jan-09 4:39 
AnswerRe: CMFCMenuBar menu manipulation problem. Pin
Shashikant_200612-Feb-09 23:53
Shashikant_200612-Feb-09 23:53 
GeneralRe: CMFCMenuBar menu manipulation problem. Pin
oleg6326-Feb-09 5:33
professionaloleg6326-Feb-09 5:33 
GeneralRe: CMFCMenuBar menu manipulation problem. Pin
neuroscript30-Jan-10 13:18
neuroscript30-Jan-10 13:18 
QuestionFile&gt;New. Window Resizes? Pin
theAce8923-Jan-09 4:16
theAce8923-Jan-09 4:16 
AnswerRe: File&gt;New. Window Resizes? Pin
Randor 23-Jan-09 7:04
professional Randor 23-Jan-09 7:04 
GeneralRe: File&gt;New. Window Resizes? Pin
theAce8929-Jan-09 11:07
theAce8929-Jan-09 11:07 
QuestionGet List of applications only Pin
vikrant kpr23-Jan-09 1:19
vikrant kpr23-Jan-09 1:19 
AnswerRe: Get List of applications only Pin
Nishad S23-Jan-09 1:49
Nishad S23-Jan-09 1:49 
AnswerRe: Get List of applications only Pin
Sarath C23-Jan-09 1:57
Sarath C23-Jan-09 1:57 
QuestionHow to change size of dialog box @ run time? Pin
sam_psycho23-Jan-09 0:50
sam_psycho23-Jan-09 0:50 
AnswerRe: How to change size of dialog box @ run time? Pin
Code-o-mat23-Jan-09 0:52
Code-o-mat23-Jan-09 0:52 
AnswerRe: How to change size of dialog box @ run time? Pin
Cedric Moonen23-Jan-09 0:54
Cedric Moonen23-Jan-09 0:54 
GeneralRe: How to change size of dialog box @ run time? Pin
sam_psycho23-Jan-09 1:02
sam_psycho23-Jan-09 1:02 

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.