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

📄 subject_40362.htm

📁 vc
💻 HTM
字号:
<p>
序号:40362 发表者:Rikcuo Akira 发表日期:2003-05-18 00:12:58
<br>主题:加入類別出現錯誤,級急!!
<br>内容:<BR>Insert&gt;New Class&gt;建立類別CMytesttt(建立後未加任何修改)<BR>在引用時加入這一行#include "mytesttt.h",執行時會出現以下錯誤,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 &gt; 1000<BR>#pragma once<BR>#endif // _MSC_VER &gt; 1000<BR><BR>class CMytesttt&nbsp;&nbsp;<BR>{<BR>public:<BR>&nbsp;&nbsp;&nbsp;&nbsp;CMytesttt();<BR>&nbsp;&nbsp;&nbsp;&nbsp;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)">返回上页</a><br><a href=http://www.copathway.com/cndevforum/>访问论坛</a></p>
<hr size=1>
<blockquote><p>
<font color=red>答案被接受</font><br>回复者:tjhe 回复日期:2003-05-18 00:34:03
<br>内容:CWebPage.c是C文件吧?加入类恐怕不行,使用类就应该是cpp文件。
<br>
<a href="javascript:history.go(-1)">返回上页</a><br><a href=http://www.copathway.com/cndevforum/>访问论坛</a></p></blockquote>
<hr size=1>
<blockquote><p>
回复者:Rikcuo Akira 回复日期:2003-05-18 04:42:32
<br>内容:要如何將.c改成.cpp,<BR>.c只能加struct,不可加class<BR>可是我將.c的內容全部複製到.cpp上再執行,又會出現語法的錯誤,到底要如何才可以將.c寫的東西轉換成.cpp文件????<BR>
<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 + -