Procedure/Function question
-
I'm using MFC programming to implement a software. Of course there are "View, Doc, mainframe...etc" file..... I've added a dialog box with a textbox for me to input some values. And I have separate file called ABC.cpp to do other things. In the ABC.cpp, I would like to pop up that dialog box to let user to input the value and then use that value in ABC.cpp. However, i got the following error message: C:\XYZ\InputNum.h(21) : error C2065: 'IDD_INPUTNUM' : undeclared identifier C:\XYZ\InputNum.h(21) : error C2057: expected constant expression I did everything already: CInputNum InputNum; InputNum.DoModal(); num = InputNum.m_inputnumber; Do you know why? and how to fix it? I don't want to make a global variable......
-
I'm using MFC programming to implement a software. Of course there are "View, Doc, mainframe...etc" file..... I've added a dialog box with a textbox for me to input some values. And I have separate file called ABC.cpp to do other things. In the ABC.cpp, I would like to pop up that dialog box to let user to input the value and then use that value in ABC.cpp. However, i got the following error message: C:\XYZ\InputNum.h(21) : error C2065: 'IDD_INPUTNUM' : undeclared identifier C:\XYZ\InputNum.h(21) : error C2057: expected constant expression I did everything already: CInputNum InputNum; InputNum.DoModal(); num = InputNum.m_inputnumber; Do you know why? and how to fix it? I don't want to make a global variable......
Looks like you are including inputnum.h without including resource.h for that translation unit. Its nicer if you can keep #includes out of header files, but including resource.h inside inputnum.h would probably solve the problem.
-
Looks like you are including inputnum.h without including resource.h for that translation unit. Its nicer if you can keep #includes out of header files, but including resource.h inside inputnum.h would probably solve the problem.
Wow........you are superb!!! Thanks.... It works!!!!