我做了个单文档formview (类CAU2VIEW)然后又添加了个dialog窗口(类CAUOE) ,现在我在fromview中 定义了个dialog类型的指针变量 CAUOE * pauoe;,然后访问formview 的m_list1成员变量。在m_list双击事件中把list中的值传给dialog中的m_edit控件。 代码void CAU2View::OnDblclkList1(NMHDR* pNMHDR, LRESULT* pResult)
{
//----鼠标双击事件list1
CString strname,str2,str3,str4;
for(id=0;id<m_list1.GetItemCount();id++)
{
if(m_list1.GetItemState(id,LVIS_SELECTED)==LVIS_SELECTED)
{ CAUOE m_auoe;
pauoe=&(m_auoe); strname=m_list1.GetItemText(id,0);
str2=m_list1.GetItemText(id,1);
str3=m_list1.GetItemText(id,2);
str4=m_list1.GetItemText(id,3); //---把值传给 子窗口中的相应控件中
pauoe->m_edit1=strname;
pauoe->m_edit2=str2;
pauoe->m_edit3=str3;
pauoe->m_edit4=str4; m_auoe.DoModal(); } }
*pResult = 0;
}
然后运行的时候都正常
但是在往下些程序 就提示error C2143: syntax error : missing ';' before '*'
d:\pb程序备份\pb乱摊子\vc\au\au2\au2view.h(33) : error C2501: 'CAU2Doc' : missing storage-class or type specifiers
d:\pb程序备份\pb乱摊子\vc\au\au2\au2view.h(33) : error C2501: 'GetDocument' : missing storage-class or type specifiers
d:\pb程序备份\pb乱摊子\vc\au\au2\au2view.h(56) : error C2143: syntax error : missing ';' before '*'
d:\pb程序备份\pb乱摊子\vc\au\au2\au2view.h(56) : error C2501: 'CAUOE' : missing storage-class or type specifiers
d:\pb程序备份\pb乱摊子\vc\au\au2\au2view.h(56) : error C2501: 'pauoe' : missing storage-class or type specifiers指向CAU2VIEW头文件中的
public:
CAU2Doc * GetDocument();
CAUOE * pauoe;然后我注视掉之后 在打开 就又没有错了 ,接着写 又是这样的错误 ,郁闷无比 大侠们 指点一下 哪里出错了啊
{
//----鼠标双击事件list1
CString strname,str2,str3,str4;
for(id=0;id<m_list1.GetItemCount();id++)
{
if(m_list1.GetItemState(id,LVIS_SELECTED)==LVIS_SELECTED)
{ CAUOE m_auoe;
pauoe=&(m_auoe); strname=m_list1.GetItemText(id,0);
str2=m_list1.GetItemText(id,1);
str3=m_list1.GetItemText(id,2);
str4=m_list1.GetItemText(id,3); //---把值传给 子窗口中的相应控件中
pauoe->m_edit1=strname;
pauoe->m_edit2=str2;
pauoe->m_edit3=str3;
pauoe->m_edit4=str4; m_auoe.DoModal(); } }
*pResult = 0;
}
然后运行的时候都正常
但是在往下些程序 就提示error C2143: syntax error : missing ';' before '*'
d:\pb程序备份\pb乱摊子\vc\au\au2\au2view.h(33) : error C2501: 'CAU2Doc' : missing storage-class or type specifiers
d:\pb程序备份\pb乱摊子\vc\au\au2\au2view.h(33) : error C2501: 'GetDocument' : missing storage-class or type specifiers
d:\pb程序备份\pb乱摊子\vc\au\au2\au2view.h(56) : error C2143: syntax error : missing ';' before '*'
d:\pb程序备份\pb乱摊子\vc\au\au2\au2view.h(56) : error C2501: 'CAUOE' : missing storage-class or type specifiers
d:\pb程序备份\pb乱摊子\vc\au\au2\au2view.h(56) : error C2501: 'pauoe' : missing storage-class or type specifiers指向CAU2VIEW头文件中的
public:
CAU2Doc * GetDocument();
CAUOE * pauoe;然后我注视掉之后 在打开 就又没有错了 ,接着写 又是这样的错误 ,郁闷无比 大侠们 指点一下 哪里出错了啊
解决方案 »
- 读取文件中特定的字符串
- 对话框内的光标是改变了,但其中的编辑控件(已子类化)光标没变过来,改写了编辑类的WM_SETCURSOR消息后,其上光标仍不变过来,为什么呢?见我的代码。
- 怎样得到视图区的颜色?????????????????????/
- CDaoRecordset的一个很奇怪的问题,请教大家
- 各位大虾求救~~~~~~C++中怎样把一幅"黑白的单色位图BMP"转成"黑白的24位图BMP"存储呢
- 请问怎么解决?can not open include file "afxres.h"
- 请问如何用我自己的窗口打开IE的链接,就象腾讯的浏览器一样?
- 那位高手知道从什么地方下载代理源代码?
- 怎样编译不需要dll
- 对话框上控件的闪动
- 用TREECTRL和LISTCTRL来做资源管理器,求资料
- 关于VFW开发视频捕捉的程序,请问怎样在视频窗口内画出一个矩形框?
dlg.m_edit1=strname;你试下。看还会不会出问题。
class CAU2Doc;
class CAU2Doc;这是什么意思 我试过了 不行
m_au2.m_list1.SetItemText(0,1,"sss"); 但是报错 这接就Debug Assertion Failed! 终止 重试 忽略了 怎么解决啊
CAU2View m_au2; 这样定义是获取View的大忌,因为主框架的View已经实例化初始化完成了,使用以下代码获取:CMainFrame *wndFrm = (CMainFrame *)AfxGetMainWnd();
CAU2View *m_au2 = (CAU2View *)wndFrm->GetActiveView();