织梦CMS - 轻松建站从此开始!

罗索

当前位置: 主页>杂项技术>VC(MFC)>

C2668: InlineIsEqualGUID:Ambiguous Call to Overloaded Functi

罗索客 发布于 2009-04-18 21:55 点击:次 
我在我的一个ATL的COM中使用了MFC的Socket,结果在编译的时候报错:C2668: InlineIsEqualGUID:Ambiguous Call to Overloaded Function。后来查了一下,才发现问题在此......
TAG:

我在我的一个ATL的COM中使用了MFC的Socket,结果在编译的时候报错:

C2668: InlineIsEqualGUID:Ambiguous Call to Overloaded Function

后来查了一下,才发现问题在此......

FIX: Error Message: C2668: InlineIsEqualGUID : Ambiguous Call to Overloaded Function
Q243298

The information in this article applies to:
• The Microsoft Active Template Library (ATL) 3.0, used with:
o Microsoft Visual C++, 32-bit Editions, version 6.0


SYMPTOMS
Building a default ATL project containing a COM object supporting ISupportErrorInfo might result in the following error:
C2668: ''InlineIsEqualGUID'' : ambiguous call to overloaded function
This error may also occur when calling the function InlineIsEqualGUID() in your ATL project.

CAUSE
The problem occurs because the function InlineIsEqualGUID() is defined both in the ATL header file, AtlBase.h, and the Platform SDK header file, Guiddef.h, in different name spaces. The include paths for the build point first to the Platform SDK include directory, and then to the ATL include directory. In the ATL header, InlineIsEqualGUID() is defined in a name space called "ATL", while in the Platform SDK header it is defined in the global name space. Because AtlBase.h includes the statement

using namespace ATL;
the compiler is unable to distinguish which definition to use.

RESOLUTION
There are three ways to work around this problem:
• Prefix the call to the InlineIsEqualGUID() function with either :: or ATL::. This explicitly indicates whether you want to use the ATL or Platform SDK definition. For example:
•
• ::InlineIsEqualGUID()
ATL::InlineIsEqualGUID()

• Change the order of the include directories on the Directory tab of the Options dialog box, which is accessed from the Tools menu, so that the ATL include directory is before the Platform SDK include directory.
• In the StdAfx.h file of your ATL project, change the path of AtlBase.h to point to the AtlBase.h file in the ATL30 directory under the Platform SDK include directory.

STATUS
Microsoft has confirmed this to be a bug in the Microsoft products listed at the beginning of this article.

This problem was corrected in the Microsoft Platform SDK January 2000 Edition.

MORE INFORMATION
Steps to Reproduce Behavior
1. Create an ATL DLL project and insert a simple object into the project with ISupportErrorInfo support.
2. Make sure that the includes path for the Platform SDK include directory comes before the ATL include directory on the Directory tab of the Options dialog box, which is accessed from the Tools menu.
3. Build the project, and the error message appears.
Additional query words: PlatSDK MMC Samples ATL Object Wizard
Keywords : kbCOMt kbDebug kbSDKPlatform kbSDKWin32 kbVC600bug kbATL300bug kbDSupport kbfix kbGrpMFCATL
Issue type : kbbug
Technology : kbvc

(落鹤生)
本站文章除注明转载外,均为本站原创或编译欢迎任何形式的转载,但请务必注明出处,尊重他人劳动,同学习共成长。转载请注明:文章转载自:罗索实验室 [http://www.rosoo.net/a/200904/7276.html]
本文出处:本站原创 作者:落鹤生
顶一下
(1)
100%
踩一下
(0)
0%
------分隔线----------------------------
发表评论
请自觉遵守互联网相关的政策法规,严禁发布色情、暴力、反动的言论。
评价:
表情:
用户名: 验证码:点击我更换图片
栏目列表
将本文分享到微信
织梦二维码生成器
推荐内容