编程论坛's Archiver

qius20002 发表于 2008-7-3 12:12

请问在子窗口中如何调用主窗体中的变量

继承自CFormView,在主窗体中内嵌了一个对话框,现在想要得到主窗体的变量。。。
利用   CFrameWnd* pWnd=(CFrameWnd*)AfxGetMainWnd();   
CHngdView* pView=(CHngdView*)(pWnd->GetActiveView());
在对话框.cpp中加入#include "HngdView.h"之后,就出现这样的错误
error C2143: syntax error : missing ';' before '*'
error C2501: 'CHngdDoc' : missing storage-class or type specifiers
error C2501: 'GetDocument' : missing storage-class or type specifiers
Error executing cl.exe.
Creating browse info file...

请各位高手帮帮忙

qius20002 发表于 2008-7-3 12:48

[tk01]

poppylx 发表于 2008-7-4 01:45

可能, 猜想, 不对勿怪.
应该是头文件相互include引起的.

页: [1]

Powered by Discuz! Archiver 6.1.0  © 2001-2007 Comsenz Inc.