473,883 Members | 1,648 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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...
DotNetManagedEx port.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\Platfo rmSDK\Include\O CIdl.h(395) : tagCONNECTDATA
CONNECTDATA'
or 'C:\Program Files\Microsoft Visual Studio .NET
2003\Vc7\includ e\vcclr.h(15) :
System::Runtime ::InteropServic es::CONNECTDATA '
C:\Program Files\Microsoft Visual Studio .NET
2003\Vc7\includ e\xmemory(136) : while compiling class-template member
function 'HRESULT
ATL::IConnectio nPointImpl<T,pi id,CDV>::EnumCo nnections(IEnum Connection
s ** )'
with
[
T=CKeyBuild,
piid=& _GUID_d74f30ea_ 21d1_4857_b8d2_ 75ba604fc8a1,
CDV=ATL::CComDy namicUnkArray
]
d:\ODP\PPS\PPS System\PPSLibNE T\_IKeyBuildEve nts_CP.h(6) : see
reference to class template instantiation
'ATL::IConnecti onPointImpl<T,p iid,CDV>' being compiled
with
[
T=CKeyBuild,
piid=& _GUID_d74f30ea_ 21d1_4857_b8d2_ 75ba604fc8a1,
CDV=ATL::CComDy namicUnkArray
]
d:\ODP\PPS\PPS System\PPSLibNE T\KeyBuild.h(17 ) : see reference to
class template instantiation 'CProxy_IKeyBui ldEvents<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\Platfo rmSDK\Include\O CIdl.h(395) : tagCONNECTDATA
CONNECTDATA'
or 'C:\Program Files\Microsoft Visual Studio .NET
2003\Vc7\includ e\vcclr.h(15) :
System::Runtime ::InteropServic es::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\Platfo rmSDK\Include\O CIdl.h(395) : tagCONNECTDATA
CONNECTDATA'
or 'C:\Program Files\Microsoft Visual Studio .NET
2003\Vc7\includ e\vcclr.h(15) :
System::Runtime ::InteropServic es::CONNECTDATA '
Nov 16 '05 #1
3 2740

--------------------
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******** ******@cpmsftng xa06.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.publi c.dotnet.langua ges.vc
NNTP-Posting-Host: user.odp.com 204.130.175.250
Path: cpmsftngxa06.ph x.gbl!TK2MSFTNG P08.phx.gbl!tk2 msftngp13.phx.g bl
Xref: cpmsftngxa06.ph x.gbl microsoft.publi c.dotnet.langua ges.vc:27149
X-Tomcat-NG: microsoft.publi c.dotnet.langua ges.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******** ******@cpmsftng xa06.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 "CONNECTDAT A" and it can't determine whether it's the one from the
namespace System::Runtime ::InteropServic es or the one from the global
namespace. Presumably you have a using namespace
System::Runtime ::InteropServic es 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 ::InteropServic es::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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
334
by: nmyatt | last post by:
Hi, The project I'm working on consists mainly of legacy VC6 C++ and VB, but we wish to write all new code in C#. So I'm looking at ways for exposing .NET functionality to VB and C++ through COM. I'm attempting to develop an ATL wrapper to expose a COM interface to a .NET assembly (I don't want to have to sign the .NET assembly to expose directly).
3
3514
by: SteveM | last post by:
I am trying to learn C++ (taking classes at the University of Washington) but have run across a bit of confusion with respect to function templates. It appears that VS 2003 has a different way of looking at things and is causing the folliwing errors when I try to build the code excerpt below: d:\C++ Projects\TemplatesTest\TemplatesTest\TemplatesTest.cpp(38): error C2668: 'max' : ambiguous call to overloaded function d:\C++...
1
1721
by: bor_kev | last post by:
Hi, i am developing under Microsoft Visual Studio 2005 (C++). I am using managed classes ( ref class Myclass) and STL.NET but i am facing two main problems : - As u know, now pointers are replaced by a new syntax( before : String * ptr ; now : String ^ ptr) that i'm using now. However, when i compile i got this error message :
0
1812
by: gerry.brennan | last post by:
Hi, I have a project which accesses a database via a database interface class which uses #include microsoft library. In the header file for this database class I have a prototype which passes by reference a CRecordset paramater.
1
6058
by: Rick | last post by:
Error 2 error C2872: 'IDataObject' : ambiguous symbol C:\Archivos de programa\Microsoft Visual Studio 8\VC\PlatformSDK\include\objidl.h 7408 this is the error i got by mix managed and unmanaged code all i do to get this is this #include "frmUsrPass.h" //this is managed code, no problem #include "client.cpp" // this is unmanaged code #include "\utils\utils.h" // this too
9
13288
by: Prasad | last post by:
HI, I am a beginner in VC++.. I am trying to write a Win32 console application in visual studio.. I am using following header files.. #include <STRING> using namespace std; #include <hash_map>//from Standard template library //and some other headers
6
16198
by: phnimx | last post by:
I'm attempting to migrate a predominately MFC application that I've just inherited from Visual Studio.NET 2003 to Visual Studio 2005. I've managed to clean up a myriad of compile and link errors but I'm stuck on one final problem. Please note that this application compiled/linked and ran just fine out of Visual Studio.NET 2003. Details: It's originally incarnated as an MFC app, i.e. CWinApp, CMultiDocTemplate,
2
1896
sangeetha jagannathan
by: sangeetha jagannathan | last post by:
hi i am migrating from vc++6 to vc++7.1. when i compile i encounter the following errors w:\tools\util\rw_utilities.h(99) : error C2872: 'ostream' : ambiguous symbol w:\tools\model_input_shell\load_file.c(478) : error C2039: 'nocreate' : is not a member of 'std::basic_ios<_Elem,_Traits>'
0
1579
by: aWiproUser | last post by:
I am upgrading my project from VC 6 to VC++.NET i am getting c2872 error. Could help me regarding this.
0
9932
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
11112
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10730
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
7959
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
7114
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5784
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4602
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
4205
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3228
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.