ATL高级示例关于添加属性的BUG,怎么解决?
在vc.net中,ATL高级示例中有一个async示例,当你按照向导在添加属性后(点右键,选择属性添加
),然后不编写任何代码,编译,出现类重定义的错误。请问如何解决?
当我在该例中用手工添加属性后,编译倒没有错误,但不能接受网页中传给该属性的值。
请问手动添加属性时,到底需要在哪些地方添加代码?
谢谢了
问题点数:80、回复次数:4Top
1 楼star_xiao(月亮湾)回复于 2005-06-04 17:00:20 得分 0
有能人帮忙解决一下吗,只要下载MSDN中的ATL的async示例,加一个属性试一下就可以看一下问题的
所在了。Top
2 楼sinall()回复于 2005-06-05 15:43:26 得分 0
没问题啊,说一下,你是怎么加的?
Top
3 楼star_xiao(月亮湾)回复于 2005-06-05 19:14:25 得分 0
我就是在接口的地方点右键,添加属性,返回类型填了BSTR属性名随便填了一个
这是输出的错误
------ 已启动生成: 项目: async, 配置: Debug Win32 ------
正在创建类型库...
Processing .\Async.idl
Async.idl
Processing D:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\include\oaidl.idl
oaidl.idl
Processing D:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\include\objidl.idl
objidl.idl
Processing D:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\include\unknwn.idl
unknwn.idl
Processing D:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\include\wtypes.idl
wtypes.idl
Processing D:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\include\basetsd.h
basetsd.h
Processing D:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\include\guiddef.h
guiddef.h
Processing D:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\include\ocidl.idl
ocidl.idl
Processing D:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\include\oleidl.idl
oleidl.idl
Processing D:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\include\servprov.idl
servprov.idl
Processing D:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\include\urlmon.idl
urlmon.idl
Processing D:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\include\msxml.idl
msxml.idl
Processing D:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\include\oaidl.acf
oaidl.acf
Processing D:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\include\ocidl.acf
ocidl.acf
正在编译...
stdafx.cpp
正在编译...
ATLAsync.cpp
f:\ProgramCode\Samples\Visual C++ .NET 2003\atl\advanced\async\ATLAsync.h(17) : error C2011: “CATLAsync” : “class”类型重定义
f:\ProgramCode\Samples\Visual C++ .NET 2003\atl\advanced\async\ATLAsync.h(17) : 参见“CATLAsync”的声明
f:\ProgramCode\Samples\Visual C++ .NET 2003\atl\advanced\async\ATLAsync.h(178) : error C2374: “__objMap_CATLAsync” : 重定义;多次初始化
f:\ProgramCode\Samples\Visual C++ .NET 2003\atl\advanced\async\ATLAsync.h(178) : 参见“__objMap_CATLAsync”的声明
f:\ProgramCode\Samples\Visual C++ .NET 2003\atl\advanced\async\ATLAsync.h(178) : error C2374: “__pobjMap_CATLAsync” : 重定义;多次初始化
f:\ProgramCode\Samples\Visual C++ .NET 2003\atl\advanced\async\ATLAsync.h(178) : 参见“__pobjMap_CATLAsync”的声明
f:\ProgramCode\Samples\Visual C++ .NET 2003\atl\advanced\async\ATLAsync.h(178) : error C3861: “__objMap_CATLAsync”: 即使使用参数相关的查找,也未找到标识符
Async.cpp
正在生成代码...
生成日志保存在“file://f:\ProgramCode\Samples\Visual C++ .NET 2003\atl\advanced\async\Debug\BuildLog.htm”中
async - 4 错误,0 警告
---------------------- 完成 ---------------------
生成: 0 已成功, 1 已失败, 0 已跳过
Top
4 楼lcriver(笑三少)回复于 2005-06-19 18:27:36 得分 80
手动加就没问题!Top




