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

📄 subject_40357.htm

📁 一些关于vc的问答
💻 HTM
字号:
<p>
序号:40357 发表者:Rikcuo Akira 发表日期:2003-05-17 23:44:47
<br>主题:為何在這個project加入class,就會出現很奇怪的錯誤訊息??
<br>内容:為何在這個project加入class,就會出現很奇怪的錯誤訊息??<BR><BR>--------------------Configuration: CWebPage - Win32 Debug--------------------<BR>Compiling...<BR>CWebPage.c<BR>C:\tmp\View html in win32\cwebpage\cwebpage\CWebPage.c(36) : error C2061: syntax error : identifier 'CMytest'<BR>C:\tmp\View html in win32\cwebpage\cwebpage\CWebPage.c(36) : error C2059: syntax error : ';'<BR>C:\tmp\View html in win32\cwebpage\cwebpage\CWebPage.c(37) : error C2449: found '{' at file scope (missing function header?)<BR>C:\tmp\View html in win32\cwebpage\cwebpage\CWebPage.c(39) : error C2059: syntax error : '}'<BR>C:\tmp\View html in win32\cwebpage\cwebpage\CWebPage.c(67) : error C2065: 'Storage_QueryInterface' : undeclared identifier<BR>C:\tmp\View html in win32\cwebpage\cwebpage\CWebPage.c(67) : error C2099: initializer is not a constant<BR>C:\tmp\View html in win32\cwebpage\cwebpage\CWebPage.c(68) : warning C4113: 'long (__stdcall *)(struct IStorage *)' differs in parameter lists from 'long (__stdcall *)(struct IStorage *,const struct _GUID *const ,void ** )'<BR>C:\tmp\View html in win32\cwebpage\cwebpage\CWebPage.c(70) : warning C4113: 'long (__stdcall *)(struct IStorage *,const unsigned short *,unsigned long ,unsigned long ,unsigned long ,struct IStream ** )' differs in parameter lists from 'unsigned long<BR> (__stdcall *)(struct IStorage *)'<BR>C:\tmp\View html in win32\cwebpage\cwebpage\CWebPage.c(71) : warning C4028: formal parameter 3 different from declaration<BR>C:\tmp\View html in win32\cwebpage\cwebpage\CWebPage.c(72) : warning C4028: formal parameter 3 different from declaration<BR>C:\tmp\View html in win32\cwebpage\cwebpage\CWebPage.c(72) : warning C4028: formal parameter 6 different from declaration<BR>C:\tmp\View html in win32\cwebpage\cwebpage\CWebPage.c(73) : warning C4113: 'long (__stdcall *)(struct IStorage *,const unsigned short *,struct IStorage *,unsigned long ,unsigned short ** ,unsigned long ,struct IStorage ** )' differs in parameter li<BR>sts from 'long (__stdcall *)(struct IStorage *,const unsigned short *,unsigned long ,unsigned long ,unsigned long ,struct IStorage ** )'<BR>C:\tmp\View html in win32\cwebpage\cwebpage\CWebPage.c(74) : warning C4113: 'long (__stdcall *)(struct IStorage *,unsigned long ,const struct _GUID *,unsigned short ** ,struct IStorage *)' differs in parameter lists from 'long (__stdcall *)(struct I<BR>Storage *,const unsigned short *,struct IStorage *,unsigned long ,unsigned short ** ,unsigned long ,struct IStorage ** )'<BR>C:\tmp\View html in win32\cwebpage\cwebpage\CWebPage.c(75) : warning C4028: formal parameter 2 different from declaration<BR>C:\tmp\View html in win32\cwebpage\cwebpage\CWebPage.c(75) : warning C4028: formal parameter 3 different from declaration<BR>C:\tmp\View html in win32\cwebpage\cwebpage\CWebPage.c(75) : warning C4028: formal parameter 4 different from declaration<BR>C:\tmp\View html in win32\cwebpage\cwebpage\CWebPage.c(75) : warning C4028: formal parameter 5 different from declaration<BR>C:\tmp\View html in win32\cwebpage\cwebpage\CWebPage.c(76) : warning C4113: 'long (__stdcall *)(struct IStorage *,unsigned long )' differs in parameter lists from 'long (__stdcall *)(struct IStorage *,const unsigned short *,struct IStorage *,const u<BR>nsigned short *,unsigned long )'<BR>C:\tmp\View html in win32\cwebpage\cwebpage\CWebPage.c(77) : warning C4113: 'long (__stdcall *)(struct IStorage *)' differs in parameter lists from 'long (__stdcall *)(struct IStorage *,unsigned long )'<BR>C:\tmp\View html in win32\cwebpage\cwebpage\CWebPage.c(78) : warning C4113: 'long (__stdcall *)(struct IStorage *,unsigned long ,void *,unsigned long ,struct IEnumSTATSTG ** )' differs in parameter lists from 'long (__stdcall *)(struct IStorage *)'<BR>C:\tmp\View html in win32\cwebpage\cwebpage\CWebPage.c(79) : warning C4113: 'long (__stdcall *)(struct IStorage *,const unsigned short *)' differs in parameter lists from 'long (__stdcall *)(struct IStorage *,unsigned long ,void *,unsigned long ,str<BR>uct IEnumSTATSTG ** )'<BR>C:\tmp\View html in win32\cwebpage\cwebpage\CWebPage.c(80) : warning C4113: 'long (__stdcall *)(struct IStorage *,const unsigned short *,const unsigned short *)' differs in parameter lists from 'long (__stdcall *)(struct IStorage *,const unsigned sh<BR>ort *)'<BR>C:\tmp\View html in win32\cwebpage\cwebpage\CWebPage.c(81) : warning C4113: 'long (__stdcall *)(struct IStorage *,const unsigned short *,const struct _FILETIME *,const struct _FILETIME *,const struct _FILETIME *)' differs in parameter lists from 'lo<BR>ng (__stdcall *)(struct IStorage *,const unsigned short *,const unsigned short *)'<BR>C:\tmp\View html in win32\cwebpage\cwebpage\CWebPage.c(82) : warning C4113: 'long (__stdcall *)(struct IStorage *,const struct _GUID *const )' differs in parameter lists from 'long (__stdcall *)(struct IStorage *,const unsigned short *,const struct <BR>_FILETIME *,const struct _FILETIME *,const struct _FILETIME *)'<BR>C:\tmp\View html in win32\cwebpage\cwebpage\CWebPage.c(83) : warning C4113: 'long (__stdcall *)(struct IStorage *,unsigned long ,unsigned long )' differs in parameter lists from 'long (__stdcall *)(struct IStorage *,const struct _GUID *const )'<BR>C:\tmp\View html in win32\cwebpage\cwebpage\CWebPage.c(84) : warning C4028: formal parameter 2 different from declaration<BR>C:\tmp\View html in win32\cwebpage\cwebpage\CWebPage.c(219) : warning C4028: formal parameter 1 different from declaration<BR>C:\tmp\View html in win32\cwebpage\cwebpage\CWebPage.c(234) : warning C4028: formal parameter 1 different from declaration<BR>C:\tmp\View html in win32\cwebpage\cwebpage\CWebPage.c(235) : warning C4028: formal parameter 1 different from declaration<BR>C:\tmp\View html in win32\cwebpage\cwebpage\CWebPage.c(319) : error C2373: 'Storage_QueryInterface' : redefinition; different type modifiers<BR>Error executing cl.exe.<BR><BR>CWebPage.exe - 7 error(s), 23 warning(s)<BR>
<br><a href="javascript:history.go(-1)">返回上页</a><br><a href=http://www.copathway.com/cndevforum/>访问论坛</a></p>
<hr size=1>
<blockquote><p>
回复者:dr0 回复日期:2003-05-18 00:06:32
<br>内容:Deleting intermediate files and output files for project 'CWebPage - Win32 Debug'.<BR>--------------------Configuration: CWebPage - Win32 Debug--------------------<BR>Compiling...<BR>CWebPage.c<BR>c:\subject_1_40357\cwebpage\cwebpage.c(216) : warning C4028: formal parameter 1 different from declaration<BR>c:\subject_1_40357\cwebpage\cwebpage.c(231) : warning C4028: formal parameter 1 different from declaration<BR>c:\subject_1_40357\cwebpage\cwebpage.c(232) : warning C4028: formal parameter 1 different from declaration<BR>Linking...<BR><BR>CWebPage.exe - 0 error(s), 3 warning(s)<BR>// it's ok on my host
<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 00:18:25
<br>内容:在這個Project再加入class<BR>如<BR>class aaa<BR>{<BR>int a;<BR>};<BR><BR>只要再加入此3行就會出錯了,我的附加檔案是還沒加入此三行的,所以請測試者還要再加入class<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>
回复者:Rikcuo Akira 回复日期:2003-05-18 00:34:22
<br>内容:測試這個就會出錯了...只加入以下幾行<BR>class aa<BR>{<BR>int a;<BR>};<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>
回复者:tjhe 回复日期:2003-05-18 00:35:22
<br>内容:不应该在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:37:50
<br>内容:若改成.cpp文件,部分語法就會出錯,真是棘手...<BR>我也像改成.cpp文件,可是技術上要如何做?<BR>.c與.cpp的差異何在?我不是很清楚...<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>
<font color=red>答案被接受</font><br>回复者:tjhe 回复日期:2003-05-18 12:44:03
<br>内容:你的程序是C方式的,<BR>注释中:This is a Win32 C application (ie, no MFC, WTL, nor even any C++ -- just plain C)<BR><BR>就用结构struct与全局函数吧,不然改造起来比较麻烦<BR><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 + -