472,133 Members | 1,172 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,133 software developers and data experts.

VS 2003 upgrades results in C2872: 'CONNECTDATA' ambiguous symbol

I have a VS6 project which I brought into VS .NET, and all has been
building fine. Then I upgraded to VS 2003 and I have one source which
will no longer compile. Any clues?

Compiling...
DotNetManagedExport.cpp
C:\Program Files\Microsoft Visual Studio .NET
2003\Vc7\atlmfc\include\atlcom.h(5529) : error C2872: 'CONNECTDATA' :
ambiguous symbol
could be 'C:\Program Files\Microsoft Visual Studio .NET
2003\Vc7\PlatformSDK\Include\OCIdl.h(395) : tagCONNECTDATA
CONNECTDATA'
or 'C:\Program Files\Microsoft Visual Studio .NET
2003\Vc7\include\vcclr.h(15) :
System::Runtime::InteropServices::CONNECTDATA'
C:\Program Files\Microsoft Visual Studio .NET
2003\Vc7\include\xmemory(136) : while compiling class-template member
function 'HRESULT
ATL::IConnectionPointImpl<T,piid,CDV>::EnumConnect ions(IEnumConnection
s ** )'
with
[
T=CKeyBuild,
piid=& _GUID_d74f30ea_21d1_4857_b8d2_75ba604fc8a1,
CDV=ATL::CComDynamicUnkArray
]
d:\ODP\PPS\PPS System\PPSLibNET\_IKeyBuildEvents_CP.h(6) : see
reference to class template instantiation
'ATL::IConnectionPointImpl<T,piid,CDV>' being compiled
with
[
T=CKeyBuild,
piid=& _GUID_d74f30ea_21d1_4857_b8d2_75ba604fc8a1,
CDV=ATL::CComDynamicUnkArray
]
d:\ODP\PPS\PPS System\PPSLibNET\KeyBuild.h(17) : see reference to
class template instantiation 'CProxy_IKeyBuildEvents<T>' being
compiled
with
[
T=CKeyBuild
]
C:\Program Files\Microsoft Visual Studio .NET
2003\Vc7\atlmfc\include\atlcom.h(5530) : error C2872: 'CONNECTDATA' :
ambiguous symbol
could be 'C:\Program Files\Microsoft Visual Studio .NET
2003\Vc7\PlatformSDK\Include\OCIdl.h(395) : tagCONNECTDATA
CONNECTDATA'
or 'C:\Program Files\Microsoft Visual Studio .NET
2003\Vc7\include\vcclr.h(15) :
System::Runtime::InteropServices::CONNECTDATA'
C:\Program Files\Microsoft Visual Studio .NET
2003\Vc7\atlmfc\include\atlcom.h(5537) : error C2872: 'CONNECTDATA' :
ambiguous symbol
could be 'C:\Program Files\Microsoft Visual Studio .NET
2003\Vc7\PlatformSDK\Include\OCIdl.h(395) : tagCONNECTDATA
CONNECTDATA'
or 'C:\Program Files\Microsoft Visual Studio .NET
2003\Vc7\include\vcclr.h(15) :
System::Runtime::InteropServices::CONNECTDATA'
Nov 16 '05 #1
3 2617

--------------------
From: "Lee Gillie" <AN*******************@odp.com>
Subject: VS 2003 upgrades results in C2872: 'CONNECTDATA' ambiguous symbol
Date: Wed, 6 Aug 2003 07:55:26 -0700
Lines: 62
I have a VS6 project which I brought into VS .NET, and all has been
building fine. Then I upgraded to VS 2003 and I have one source which
will no longer compile. Any clues?


Try moving your "using namespace System;" directive down after the
#includes. Does that solve the problem?

--
Arjun Bijanki, Microsoft Visual C++ Team
This posting is provided "AS IS" with no warranties, and confers no rights.
Use of included script samples are subject to the terms specified at
http://www.microsoft.com/info/cpyright.htm

Nov 16 '05 #2
Ajun -

Thanks for replying. I tried what you suggested, but it made no
difference. I tried also moving the #using <xxx.dll> statements.

- Lee

"Arjun Bijanki [VCPP MSFT]" <ar****@online.microsoft.com> wrote in
message news:18**************@cpmsftngxa06.phx.gbl...

--------------------
From: "Lee Gillie" <AN*******************@odp.com>
Subject: VS 2003 upgrades results in C2872: 'CONNECTDATA' ambiguous symbol Date: Wed, 6 Aug 2003 07:55:26 -0700
Lines: 62

I have a VS6 project which I brought into VS .NET, and all has been building fine. Then I upgraded to VS 2003 and I have one source which will no longer compile. Any clues?


Try moving your "using namespace System;" directive down after the
#includes. Does that solve the problem?

--
Arjun Bijanki, Microsoft Visual C++ Team
This posting is provided "AS IS" with no warranties, and confers no

rights. Use of included script samples are subject to the terms specified at
http://www.microsoft.com/info/cpyright.htm

Nov 16 '05 #3

--------------------
From: "Lee Gillie" <AN*******************@odp.com>
References: <ug**************@TK2MSFTNGP09.phx.gbl> <18**************@cpmsftngxa06.phx.gbl>Subject: Re: VS 2003 upgrades results in C2872: 'CONNECTDATA' ambiguous symbolDate: Tue, 12 Aug 2003 09:13:32 -0700
Lines: 37
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
Message-ID: <ei*************@tk2msftngp13.phx.gbl>
Newsgroups: microsoft.public.dotnet.languages.vc
NNTP-Posting-Host: user.odp.com 204.130.175.250
Path: cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!tk2msftn gp13.phx.gbl
Xref: cpmsftngxa06.phx.gbl microsoft.public.dotnet.languages.vc:27149
X-Tomcat-NG: microsoft.public.dotnet.languages.vc

Ajun -

Thanks for replying. I tried what you suggested, but it made no
difference. I tried also moving the #using <xxx.dll> statements.

- Lee

"Arjun Bijanki [VCPP MSFT]" <ar****@online.microsoft.com> wrote in
message news:18**************@cpmsftngxa06.phx.gbl...

--------------------
> From: "Lee Gillie" <AN*******************@odp.com>
> Subject: VS 2003 upgrades results in C2872: 'CONNECTDATA'ambiguous symbol > Date: Wed, 6 Aug 2003 07:55:26 -0700
> Lines: 62

>
> I have a VS6 project which I brought into VS .NET, and all hasbeen > building fine. Then I upgraded to VS 2003 and I have one sourcewhich > will no longer compile. Any clues?
>


Try moving your "using namespace System;" directive down after the
#includes. Does that solve the problem?

--
Arjun Bijanki, Microsoft Visual C++ Team
This posting is provided "AS IS" with no warranties, and confers no

rights.
Use of included script samples are subject to the terms specified at
http://www.microsoft.com/info/cpyright.htm



Lee,

The ambiguous symbol error simply says that the compiler has seen a symbol
called "CONNECTDATA" and it can't determine whether it's the one from the
namespace System::Runtime::InteropServices or the one from the global
namespace. Presumably you have a using namespace
System::Runtime::InteropServices directive somewhere in your code. Try
doing one of these:

1. Localize the directive. Instead of putting it in the global namespace
move it to a local scope where you need it.

2. Use a *using declaration* instead of a using directive:

using System::Runtime::InteropServices::CONNECTDATA;

If there's any ambiguity at this point, you'll get an immediate error.

3. Remove the using directive and use the fully qualified name.

Option (3) should solve your problem if (1) and (2) don't work.
--
Tanveer Gani, Microsoft Visual C++ Team
This posting is provided "AS IS" with no warranties, and confers no rights.
Use of included script samples are subject to the terms specified at
http://www.microsoft.com/info/cpyright.htm
Nov 16 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

1 post views Thread by bor_kev | last post: by
reply views Thread by gerry.brennan | last post: by
1 post views Thread by Rick | last post: by
sangeetha jagannathan
2 posts views Thread by sangeetha jagannathan | last post: by
reply views Thread by leo001 | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.