Did I miss something?
-
I declared a public variable on MainFrm.h called int m_enableD. I use #include "MainFrm.h" in my ProgramView.cpp but when I compiled it, it says "error C2065: m_enableD : undeclared identifier". Did I miss something? I usually did the same way and it works. Thanks.
-
I declared a public variable on MainFrm.h called int m_enableD. I use #include "MainFrm.h" in my ProgramView.cpp but when I compiled it, it says "error C2065: m_enableD : undeclared identifier". Did I miss something? I usually did the same way and it works. Thanks.
-
The variable is declared in CMainFrame class So you can use like this... CMainFrame *pFrame = (CMainFrame*)AfxGetMainWnd(); if(pFrame->m_enableD == 0) { //TODO }
-
Thanks it works. I am new to VC++, could you explain why I can use other variables but not this? Thanks
You have declared a public varibale in one class,that means you can access that varable outide the class,but only through its member varible. jw81 wrote: why I can use other variables but not this? I didn't ge exaclty what you mean... But you can direclty use a varible if it is the same class' member varible.