?? subject_40362.htm
字號(hào):
<p>
序號(hào):40362 發(fā)表者:Rikcuo Akira 發(fā)表日期:2003-05-18 00:12:58
<br>主題:加入類別出現(xiàn)錯(cuò)誤,級(jí)急!!
<br>內(nèi)容:<BR>Insert>New Class>建立類別CMytesttt(建立後未加任何修改)<BR>在引用時(shí)加入這一行#include "mytesttt.h",執(zhí)行時(shí)會(huì)出現(xiàn)以下錯(cuò)誤,Why??<BR><BR>// Mytesttt.h: interface for the CMytesttt class.<BR>//<BR>//////////////////////////////////////////////////////////////////////<BR><BR>#if !defined(AFX_MYTESTTT_H__2A7E3241_88C4_11D7_A92B_444553540001__INCLUDED_)<BR>#define AFX_MYTESTTT_H__2A7E3241_88C4_11D7_A92B_444553540001__INCLUDED_<BR><BR>#if _MSC_VER > 1000<BR>#pragma once<BR>#endif // _MSC_VER > 1000<BR><BR>class CMytesttt <BR>{<BR>public:<BR> CMytesttt();<BR> virtual ~CMytesttt();<BR><BR>};<BR><BR>#endif // !defined(AFX_MYTESTTT_H__2A7E3241_88C4_11D7_A92B_444553540001__INCLUDED_)<BR><BR><BR><BR>// Mytesttt.cpp: implementation of the CMytesttt class.<BR>//<BR>//////////////////////////////////////////////////////////////////////<BR><BR>#include "Mytesttt.h"<BR><BR>//////////////////////////////////////////////////////////////////////<BR>// Construction/Destruction<BR>//////////////////////////////////////////////////////////////////////<BR><BR>CMytesttt::CMytesttt()<BR>{<BR>}<BR><BR>CMytesttt::~CMytesttt()<BR>{<BR>}<BR><BR><BR>--------------------Configuration: CWebPage - Win32 Debug--------------------<BR>Compiling...<BR>CWebPage.c<BR>c:\tmp\my cwebpage modify\mytesttt.h(12) : error C2061: syntax error : identifier 'CMytesttt'<BR>c:\tmp\my cwebpage modify\mytesttt.h(12) : error C2059: syntax error : ';'<BR>c:\tmp\my cwebpage modify\mytesttt.h(13) : error C2449: found '{' at file scope (missing function header?)<BR>c:\tmp\my cwebpage modify\mytesttt.h(18) : error C2059: syntax error : '}'<BR>C:\tmp\my cwebpage modify\CWebPage.c(1196) : error C2065: 'WindowCount' : undeclared identifier<BR>Error executing cl.exe.<BR><BR>CWebPage.exe - 5 error(s), 0 warning(s)<BR><BR><BR><BR>
<br><a href="javascript:history.go(-1)">返回上頁(yè)</a><br><a href=http://www.copathway.com/cndevforum/>訪問(wèn)論壇</a></p>
<hr size=1>
<blockquote><p>
<font color=red>答案被接受</font><br>回復(fù)者:tjhe 回復(fù)日期:2003-05-18 00:34:03
<br>內(nèi)容:CWebPage.c是C文件吧?加入類恐怕不行,使用類就應(yīng)該是cpp文件。
<br>
<a href="javascript:history.go(-1)">返回上頁(yè)</a><br><a href=http://www.copathway.com/cndevforum/>訪問(wèn)論壇</a></p></blockquote>
<hr size=1>
<blockquote><p>
回復(fù)者:Rikcuo Akira 回復(fù)日期:2003-05-18 04:42:32
<br>內(nèi)容:要如何將.c改成.cpp,<BR>.c只能加struct,不可加class<BR>可是我將.c的內(nèi)容全部複製到.cpp上再執(zhí)行,又會(huì)出現(xiàn)語(yǔ)法的錯(cuò)誤,到底要如何才可以將.c寫的東西轉(zhuǎn)換成.cpp文件????<BR>
<br>
<a href="javascript:history.go(-1)">返回上頁(yè)</a><br><a href=http://www.copathway.com/cndevforum/>訪問(wèn)論壇</a></p></blockquote>
?? 快捷鍵說(shuō)明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -