⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 subject_39178.htm

📁 vc
💻 HTM
字号:
<p>
序号:39178 发表者:wuzhang 发表日期:2003-05-08 19:05:55
<br>主题:为什么是这样呢????是什么原因呢???
<br>内容:在编译下面的语句时<BR>void CChainTable::Insert(MsgChain &amp;msg)<BR><BR>{<BR>&nbsp;&nbsp; m_Table.push_back( msg );&nbsp;&nbsp;是这里有问题?????<BR>}<BR>总是有下面问题<BR>c:\program files\microsoft visual studio\vc98\include\xmemory(34) : error C2558: struct 'tagMsgChain' : no copy constructor available<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;c:\program files\microsoft visual studio\vc98\include\xmemory(66) : see reference to function template instantiation 'void __cdecl std::_Construct(struct tagMsgChain *,const struct tagMsgChain &amp;)' being compiled<BR>Error executing cl.exe.
<br><a href="javascript:history.go(-1)">返回上页</a><br><a href=http://www.copathway.com/cndevforum/>访问论坛</a></p>
<hr size=1>
<blockquote><p>
<font color=red>答案被接受</font><br>回复者:擎天柱 回复日期:2003-05-08 21:22:28
<br>内容:struct 'tagMsgChain' : no copy constructor available<BR><BR>m_Table是什么东西?vector吗?<BR><BR>
<br>
<a href="javascript:history.go(-1)">返回上页</a><br><a href=http://www.copathway.com/cndevforum/>访问论坛</a></p></blockquote>
<hr size=1>
<blockquote><p>
回复者:wuzhang 回复日期:2003-05-09 08:12:11
<br>内容:typedef struct tagMsgChain<BR>{<BR>&nbsp;&nbsp;&nbsp;&nbsp;CMyEdit&nbsp;&nbsp;&nbsp;&nbsp;editobj;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;CRect&nbsp;&nbsp;&nbsp;&nbsp; rect ;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<BR><BR>}MsgChain, *LPMsgChain;<BR><BR>&nbsp;&nbsp;&nbsp;&nbsp;typedef list&lt;MsgChain&gt; Table_t;<BR>void CChainTable::Insert(MsgChain &amp;msg)<BR>{<BR>&nbsp;&nbsp; m_Table.push_back( msg ); //这语句编译是有问题<BR>}<BR>总是有下面问题<BR>c:\program files\microsoft visual studio\vc98\include\xmemory(34) : error C2558: struct 'tagMsgChain' : no copy constructor available<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;c:\program files\microsoft visual studio\vc98\include\xmemory(66) : see reference to function template instantiation 'void __cdecl std::_Construct(struct tagMsgChain *,const struct tagMsgChain &amp;)' being compiled<BR>Error executing cl.exe. 
<br>
<a href="javascript:history.go(-1)">返回上页</a><br><a href=http://www.copathway.com/cndevforum/>访问论坛</a></p></blockquote>
<hr size=1>
<blockquote><p>
回复者:wuzhang 回复日期:2003-05-09 08:15:26
<br>内容:Table_t&nbsp;&nbsp;m_Table 
<br>
<a href="javascript:history.go(-1)">返回上页</a><br><a href=http://www.copathway.com/cndevforum/>访问论坛</a></p></blockquote>
<hr size=1>
<blockquote><p>
回复者:擎天柱 回复日期:2003-05-09 08:16:54
<br>内容:问题很可能出在<BR>CMyEdit&nbsp;&nbsp;&nbsp;&nbsp;editobj; <BR>CMyEdit是CEdit吧!<BR>如果是的话把它改成CMyEdit* pEditObj;
<br>
<a href="javascript:history.go(-1)">返回上页</a><br><a href=http://www.copathway.com/cndevforum/>访问论坛</a></p></blockquote>
<hr size=1>
<blockquote><p>
回复者:wuzhang 回复日期:2003-05-09 09:33:36
<br>内容:对啦?
<br>
<a href="javascript:history.go(-1)">返回上页</a><br><a href=http://www.copathway.com/cndevforum/>访问论坛</a></p></blockquote>
<hr size=1>
<blockquote><p>
回复者:wuzhang 回复日期:2003-05-09 16:09:23
<br>内容:为什么运行这两块代码后<BR>{<BR> MsgChain msg ;<BR> memset(&amp;msg, 0, sizeof(MsgChain));<BR> msg.pEditObj = &amp; m_EditObj[m_editobjcount];<BR> msg.Rect = m_FirstRect;&nbsp;&nbsp;&nbsp;&nbsp;是一个矩形变量<BR>&nbsp;&nbsp;m_ChainTable.Insert ( msg);<BR>}<BR>{<BR>&nbsp;&nbsp;MsgChain msg ;<BR>&nbsp;&nbsp; memset(&amp;msg, 0, sizeof(MsgChain));<BR>&nbsp;&nbsp; msg.pEditObj = &amp; m_EditObj[m_editobjcount];&nbsp;&nbsp; 是与上面不同的值<BR>&nbsp;&nbsp; msg.Rect = underect;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 是一个矩形变量<BR>&nbsp;&nbsp; m_ChainTable.Insert ( msg);<BR>}<BR>size_t&nbsp;&nbsp;nsize =m_ChainTable .Size ();&nbsp;&nbsp;&nbsp;&nbsp;nsize 的值总是1呢??????<BR><BR><BR>size_t Size() const { return m_Table.size(); }
<br>
<a href="javascript:history.go(-1)">返回上页</a><br><a href=http://www.copathway.com/cndevforum/>访问论坛</a></p></blockquote>
<hr size=1>
<blockquote><p>
回复者:wuzhang 回复日期:2003-05-09 17:00:37
<br>内容:size_t&nbsp;&nbsp;nsize =m_ChainTable .Size (); 是两个值<BR>void CMyEdit::OnLButtonDown(UINT nFlags, CPoint point) <BR>{ <BR>&nbsp;&nbsp;&nbsp;&nbsp;CEdit::OnLButtonDown(nFlags, point);<BR>&nbsp;&nbsp;&nbsp;&nbsp;CTestorgView&nbsp;&nbsp;*pView=GetpView();<BR>&nbsp;&nbsp;&nbsp;&nbsp;ASSERT(pView!=NULL);<BR>&nbsp;&nbsp;&nbsp;&nbsp;CChainTable::Table_t ::iterator i;<BR>&nbsp;&nbsp;&nbsp;&nbsp;size_t&nbsp;&nbsp;nsize = pView-&gt;m_ChainTable .Size ();<BR>&nbsp;&nbsp;&nbsp;&nbsp;if(pView-&gt;m_bAddUnder )<BR>&nbsp;&nbsp;&nbsp;&nbsp;{<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;for(i =pView-&gt;m_ChainTable.m_Table.begin(); //为什么这里只取出第一个<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;i !=pView-&gt;m_ChainTable.m_Table.end(); ///矩形??????<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;++i)<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;point.x +=i-&gt;Rect .left ;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;point.y +=i-&gt;Rect .top ;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if(i-&gt;Rect.PtInRect(point))<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{<BR>//&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;pView-&gt;m_editobjcount ++;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; pView-&gt;DrawUnder (i-&gt;Rect );<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;break;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;}
<br>
<a href="javascript:history.go(-1)">返回上页</a><br><a href=http://www.copathway.com/cndevforum/>访问论坛</a></p></blockquote>
<hr size=1>
<blockquote><p>
回复者:wuzhang 回复日期:2003-05-09 17:20:01
<br>内容:对啦!!! 忘了break;
<br>
<a href="javascript:history.go(-1)">返回上页</a><br><a href=http://www.copathway.com/cndevforum/>访问论坛</a></p></blockquote>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -