How to inherit a MFC class.
-
Hi everyone, In my application i am using a hell lot no. of list controls. So i have defined a CCustomListCtrl class derived from CListCtrl class. I have defined the NM and WM functionalities and other stuff in it and it runs just the way i want it. Now i want to define rest of the class derived from CCustomListCtrl. When i do this compiler gives an error unresolved external symbol "public: virtual int __thiscall CCustomList::PreTranslateMessage(struct tagMSG *)" (?PreTranslateMessage@CCustomList@@UAEHPAUtagMSG@@@Z) All the errors are related to the WM and NM .I guess the problem is in BEGIN_MESSAGE_MAP(CCustomListCtrl, CListCtrl) macro. How do i remove this error.
-
Hi everyone, In my application i am using a hell lot no. of list controls. So i have defined a CCustomListCtrl class derived from CListCtrl class. I have defined the NM and WM functionalities and other stuff in it and it runs just the way i want it. Now i want to define rest of the class derived from CCustomListCtrl. When i do this compiler gives an error unresolved external symbol "public: virtual int __thiscall CCustomList::PreTranslateMessage(struct tagMSG *)" (?PreTranslateMessage@CCustomList@@UAEHPAUtagMSG@@@Z) All the errors are related to the WM and NM .I guess the problem is in BEGIN_MESSAGE_MAP(CCustomListCtrl, CListCtrl) macro. How do i remove this error.
-
Hi everyone, In my application i am using a hell lot no. of list controls. So i have defined a CCustomListCtrl class derived from CListCtrl class. I have defined the NM and WM functionalities and other stuff in it and it runs just the way i want it. Now i want to define rest of the class derived from CCustomListCtrl. When i do this compiler gives an error unresolved external symbol "public: virtual int __thiscall CCustomList::PreTranslateMessage(struct tagMSG *)" (?PreTranslateMessage@CCustomList@@UAEHPAUtagMSG@@@Z) All the errors are related to the WM and NM .I guess the problem is in BEGIN_MESSAGE_MAP(CCustomListCtrl, CListCtrl) macro. How do i remove this error.
It's not really much info you posted but check if the declaration and definition of the method
PreTranslateMessage()
is correct. When I look at yourBEGIN_MESSAGE_MAP
macro your class seems to be calledCCustomListCtrl
but the definition ofPreTranslateMessage()
contains a class namedCCustomList
:CCustomList::PreTranslateMessage(struct tagMSG *)
cheers, mykel
OMM: "Let us be thankful we have an occupation to fill. Work hard, increase production, prevent accidents and be happy."
-
Hi everyone, In my application i am using a hell lot no. of list controls. So i have defined a CCustomListCtrl class derived from CListCtrl class. I have defined the NM and WM functionalities and other stuff in it and it runs just the way i want it. Now i want to define rest of the class derived from CCustomListCtrl. When i do this compiler gives an error unresolved external symbol "public: virtual int __thiscall CCustomList::PreTranslateMessage(struct tagMSG *)" (?PreTranslateMessage@CCustomList@@UAEHPAUtagMSG@@@Z) All the errors are related to the WM and NM .I guess the problem is in BEGIN_MESSAGE_MAP(CCustomListCtrl, CListCtrl) macro. How do i remove this error.
-
Hi everyone, In my application i am using a hell lot no. of list controls. So i have defined a CCustomListCtrl class derived from CListCtrl class. I have defined the NM and WM functionalities and other stuff in it and it runs just the way i want it. Now i want to define rest of the class derived from CCustomListCtrl. When i do this compiler gives an error unresolved external symbol "public: virtual int __thiscall CCustomList::PreTranslateMessage(struct tagMSG *)" (?PreTranslateMessage@CCustomList@@UAEHPAUtagMSG@@@Z) All the errors are related to the WM and NM .I guess the problem is in BEGIN_MESSAGE_MAP(CCustomListCtrl, CListCtrl) macro. How do i remove this error.
chaitannya_m wrote:
BEGIN_MESSAGE_MAP(CCustomListCtrl, CListCtrl)
The Syntax here is
BEGIN_MESSAGE_MAP(Classname, Baseclassname)
Did you turn it around?
Failure is not an option - it's built right in.
-
It's not really much info you posted but check if the declaration and definition of the method
PreTranslateMessage()
is correct. When I look at yourBEGIN_MESSAGE_MAP
macro your class seems to be calledCCustomListCtrl
but the definition ofPreTranslateMessage()
contains a class namedCCustomList
:CCustomList::PreTranslateMessage(struct tagMSG *)
cheers, mykel
OMM: "Let us be thankful we have an occupation to fill. Work hard, increase production, prevent accidents and be happy."
Hey thanks.. Great observation ...!!! the error was there.. There was another class CCustomList which i delete because i completely messed up with.. Code is working fine now
-
Hey thanks.. Great observation ...!!! the error was there.. There was another class CCustomList which i delete because i completely messed up with.. Code is working fine now
You're welcome! Perhaps next time use search and replace when you rename your classes... ;P
cheers, mykel
OMM: "Let us be thankful we have an occupation to fill. Work hard, increase production, prevent accidents and be happy."