Problems calling another dialog box.
-
Hi, I'm (attempting) to make a MFC Dialog based application. In my application I have a dialog box that calls another dialog box. Each have there own class "CDialog1" and "CDialog2". When Dialog1.cpp wants to call CDialog2 I created a private variable of CDialog2 called m_dDialog2 (in CDialog1) and in Dialog1.cpp it calls it using m_dDialog2.DoModal(). This was all working fine but now when I compile I get the following errors: c:\proj\interf\dialog1.h(18) : error C2146: syntax error : missing ';' before identifier 'm_dDialog2' c:\proj\interf\dialog1.h(18) : error C2501: 'CDialog2' : missing storage-class or type specifiers c:\proj\interf\dialog1.h(18) : error C2501: 'm_dDialog2' : missing storage-class or type specifiers I didn't make any changes myself to any of the code in dialog1.h But the strange this is that sometimes (not all the time) when I delete the variable and add it again using "Add Member Variable" it compiles and runs fine. Then after running it I compile it again (without making changes) and the three errors return. I'm getting really frustrated so any comments would be really welcome. Thanks, Aoife
-
Hi, I'm (attempting) to make a MFC Dialog based application. In my application I have a dialog box that calls another dialog box. Each have there own class "CDialog1" and "CDialog2". When Dialog1.cpp wants to call CDialog2 I created a private variable of CDialog2 called m_dDialog2 (in CDialog1) and in Dialog1.cpp it calls it using m_dDialog2.DoModal(). This was all working fine but now when I compile I get the following errors: c:\proj\interf\dialog1.h(18) : error C2146: syntax error : missing ';' before identifier 'm_dDialog2' c:\proj\interf\dialog1.h(18) : error C2501: 'CDialog2' : missing storage-class or type specifiers c:\proj\interf\dialog1.h(18) : error C2501: 'm_dDialog2' : missing storage-class or type specifiers I didn't make any changes myself to any of the code in dialog1.h But the strange this is that sometimes (not all the time) when I delete the variable and add it again using "Add Member Variable" it compiles and runs fine. Then after running it I compile it again (without making changes) and the three errors return. I'm getting really frustrated so any comments would be really welcome. Thanks, Aoife
Aoife wrote: c:\proj\interf\dialog1.h(18) : error C2146: syntax error : missing ';' before identifier 'm_dDialog2'
#include "Dialog2.h"
inside the dialog1.h file. Maxwell Chen No code is good code.
-
Aoife wrote: c:\proj\interf\dialog1.h(18) : error C2146: syntax error : missing ';' before identifier 'm_dDialog2'
#include "Dialog2.h"
inside the dialog1.h file. Maxwell Chen No code is good code.