Click here to Skip to main content
15,897,518 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionRe: Get text from the focused control in another window Pin
David Crow23-Jan-09 6:10
David Crow23-Jan-09 6:10 
AnswerRe: Get text from the focused control in another window Pin
nc3b23-Jan-09 6:14
nc3b23-Jan-09 6:14 
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 
I have a template function to check the type passed to it. I am templatizing it on a derived type but when I break in the function, the template parameter is the base class. A sample app is below. Can someone please explain where I am going wrong?
Thanks

class Base
{
public:
	virtual ~Base() {}
};

class Derived1 : public Base {};

class Derived2 : public Base {};

template<class T> bool CheckType(boost::shared_ptr<Base> pBase)
{
	T* pTemplate = NULL;  //Why is pTemplate Base* and not Derived1* when passing a Derived1 to template parameter?
	Base* pBaseRaw = pBase.get();
	if(typeid(pBaseRaw) == typeid(pTemplate))
	{
		return true;
	}

	return false;
}

int _tmain(int argc, _TCHAR* argv[])
{
	boost::shared_ptr<Base> pBase1(new Derived1);
	boost::shared_ptr<Base> pBase2(new Derived2);
	bool bIsDerived = CheckType<Derived1>(pBase1);
	bIsDerived = CheckType<Derived2>(pBase2);

	return 0;
}

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 
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 

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.