我在Dialog1.h中的public:中定义Dialog* as; 然后从Dialog2.cpp中使用 as->m_list1.SetSel(-1,true); 我在Dialog2.cpp中已定义#include "Dialog1.h" 为什末编译时还出错? D:\book\R\Dialog2.cpp(49) : error C2065: 'as' : undeclared identifier D:\book\R\Dialog2.cpp(49) : error C2227: left of '->m_list1' must point to class/struct/union D:\book\R\Dialog2.cpp(49) : error C2228: left of '.SetSel' must have class/struct/union type
然后从Dialog2.cpp中使用 as->m_list1.SetSel(-1,true);
我在Dialog2.cpp中已定义#include "Dialog1.h"
为什末编译时还出错?
D:\book\R\Dialog2.cpp(49) : error C2065: 'as' : undeclared identifier
D:\book\R\Dialog2.cpp(49) : error C2227: left of '->m_list1' must point to class/struct/union
D:\book\R\Dialog2.cpp(49) : error C2228: left of '.SetSel' must have class/struct/union type
然后在初始化时把Dialog1的一个对象指针传给他就行了,
pi譬如:
Dialog1 *s;
... ....
Dialog2.as=s;
......
在Dialog2里用as->m_list1.SetSel(-1,false);
呜呜呜
我还是不明白
艾
可怜自己水平太浅那
这位大哥如果您有时间就写个例程mail过来吧
[email protected]
我给您分数的!