Cant find insert section "AFX_MSG"
-
Hi I am creating a CObject-derived class by first creating a class with CDocument as base class, and then replacing all 'CDocument' with 'CObject' and then removing the below message maps functions from the source and header files. BEGIN_MESSAGE_MAP(CMyClass, CObject) //{{AFX_MSG_MAP(CMyClass) // NOTE - the ClassWizard will add and remove mapping macros here. //}}AFX_MSG_MAP END_MESSAGE_MAP() and // Generated message map functions protected: //{{AFX_MSG(CMyClass) // NOTE - the ClassWizard will add and remove member functions here. //}}AFX_MSG DECLARE_MESSAGE_MAP() I have no problem compiling the program but when i try to use the class wizard, an error dialog box appeared with: "Cannot find the insert section "AFX_MSG" in file.Class wizard cannot import or edit this class." Anyone with suggestions as to what i should do?
-
Hi I am creating a CObject-derived class by first creating a class with CDocument as base class, and then replacing all 'CDocument' with 'CObject' and then removing the below message maps functions from the source and header files. BEGIN_MESSAGE_MAP(CMyClass, CObject) //{{AFX_MSG_MAP(CMyClass) // NOTE - the ClassWizard will add and remove mapping macros here. //}}AFX_MSG_MAP END_MESSAGE_MAP() and // Generated message map functions protected: //{{AFX_MSG(CMyClass) // NOTE - the ClassWizard will add and remove member functions here. //}}AFX_MSG DECLARE_MESSAGE_MAP() I have no problem compiling the program but when i try to use the class wizard, an error dialog box appeared with: "Cannot find the insert section "AFX_MSG" in file.Class wizard cannot import or edit this class." Anyone with suggestions as to what i should do?
why did you remove those blocks of code? they are (obviously) what the CW is looking for. -c
Zzzzz...
-
why did you remove those blocks of code? they are (obviously) what the CW is looking for. -c
Zzzzz...
because what i actually want is a CObject-derived class, not CDocument-derived. And CObject-derived classes has no no message mapping.(This method of deriving from CObject class is taught by someone) Actually, why does it want to find the insert section for "AFX_MSG"? thks thks
-
because what i actually want is a CObject-derived class, not CDocument-derived. And CObject-derived classes has no no message mapping.(This method of deriving from CObject class is taught by someone) Actually, why does it want to find the insert section for "AFX_MSG"? thks thks
raner wrote: Actually, why does it want to find the insert section for "AFX_MSG"? MFC needs it for message mapping. Maybe you did not remove everything needed. Actually, to derive a class from a CObject, you only need to add the class with the wizard, and say you want it to be derived from CObject. ~RaGE();
-
because what i actually want is a CObject-derived class, not CDocument-derived. And CObject-derived classes has no no message mapping.(This method of deriving from CObject class is taught by someone) Actually, why does it want to find the insert section for "AFX_MSG"? thks thks
raner wrote: Actually, why does it want to find the insert section for "AFX_MSG"? Its a guess but: Possibly becuase the CDocument object used the DECLARE_SERIAL() / IMPLEMENT_SERIAL() macros and you need to switch to DECLARE_DYNAMIC() / IMPLEMENT_DYNAMIC() ? Roger Allen Sonork 100.10016 This is a multiple choice question, choose wisely Why did the hedgehog cross the road? A: To show he had guts? B: To see his flat mate?
-
raner wrote: Actually, why does it want to find the insert section for "AFX_MSG"? Its a guess but: Possibly becuase the CDocument object used the DECLARE_SERIAL() / IMPLEMENT_SERIAL() macros and you need to switch to DECLARE_DYNAMIC() / IMPLEMENT_DYNAMIC() ? Roger Allen Sonork 100.10016 This is a multiple choice question, choose wisely Why did the hedgehog cross the road? A: To show he had guts? B: To see his flat mate?
-
because what i actually want is a CObject-derived class, not CDocument-derived. And CObject-derived classes has no no message mapping.(This method of deriving from CObject class is taught by someone) Actually, why does it want to find the insert section for "AFX_MSG"? thks thks
a better question is: if you don't need message mapping, what do you need the CW for? -c
Zzzzz...
-
a better question is: if you don't need message mapping, what do you need the CW for? -c
Zzzzz...
actually i don't really need the class wizard for that class...but the error message appearing every time i activate the CW seem to mean that something is terribly wrong? So i thought if i don't fix it now, it's bound to give me problems someday? was i wrong?
-
actually i don't really need the class wizard for that class...but the error message appearing every time i activate the CW seem to mean that something is terribly wrong? So i thought if i don't fix it now, it's bound to give me problems someday? was i wrong?
in that case, i think you were right to delete those sections. and, i think you should get rid of any //{{AFX_* comments in there (leave any delcarations, etc. - just get rid of the comment lines). those are all the places CW is scanning. also, you should delete the *.CLW file for your project, then re-run CW. hopefully, it won't try to re-parse your class. -c