subject_16517.htm
来自「一些关于vc的问答」· HTM 代码 · 共 21 行
HTM
21 行
<p>
序号:16517 发表者:lemon 发表日期:2002-09-29 09:58:00
<br>主题:请大家帮帮忙!
<br>内容:我在做MSDN的一个ADO例子的时候,要求在StdAfx.h文件中 import MsADO10.dll的路径<BR>我这么写的:<BR>#import "C:\Program Files\Common Files\System\ado\msado10.dll" <BR><BR>可是编译的时候却出问题,老是编译不通过,错误如下:<BR><BR>c:\samples\vc98\com\adosamp\server\debug\msado10.tlh(814) : error C2629: unexpected 'short ('<BR><BR>c:\samples\vc98\com\adosamp\server\debug\msado10.tlh(814) : error C2238: unexpected token(s) preceding ';'<BR><BR>TO DO: Add the path to msado10.dll to Tools.Options.Directories.Include Files. This is usually "c:\Program Files\Common Files\system\ado"<BR><BR>我在Tools.Options.Directories.Include Files中加了c:\Program Files\Common Files\system\ado的路径,可还是不行。<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>回复者:iwill 回复日期:2002-09-29 10:00:59
<br>内容:#import "C:\Program Files\Common Files\System\ado\msado15.dll" no_namespace rename("EOF","adoEOF")
<br>
<a href="javascript:history.go(-1)">返回上页</a><br><a href=http://www.copathway.com/cndevforum/>访问论坛</a></p></blockquote>
<hr size=1>
<blockquote><p>
回复者:lemon 回复日期:2002-09-29 10:12:01
<br>内容:谢谢!问题就是出在后面的没加。<BR>麻烦再问一下:no_namespace rename("EOF","adoEOF")这是什么意思?
<br>
<a href="javascript:history.go(-1)">返回上页</a><br><a href=http://www.copathway.com/cndevforum/>访问论坛</a></p></blockquote>
<hr size=1>
<blockquote><p>
回复者:iwill 回复日期:2002-09-29 10:17:44
<br>内容:看看#import指令的相关内容:<BR><BR>The no_namespace attribute<BR>The type-library contents in the #import header file are normally defined in a namespace. The namespace name is specified in the library statement of the original IDL file. If the no_namespace attribute is specified, this namespace is not generated by the compiler. <BR><BR>If you want to use a different namespace name, use the rename_namespace attribute instead.<BR><BR>The rename attribute<BR>rename("OldName","NewName")<BR><BR>OldName<BR><BR>Old name in the type library<BR><BR>NewName<BR><BR>Name to be used instead of the old name<BR><BR>The rename attribute is used to work around name collision problems. If this attribute is specified, the compiler replaces all occurrences of OldName in a type library with the user-supplied NewName in the resulting header files.<BR><BR>This attribute can be used when a name in the type library coincides with a macro definition in the system header files. If this situation is not resolved, then various syntax errors will be generated, such as C2059 and C2061.<BR><BR>间<BR>2002-9-29 10:25:24
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?