473,569 Members | 2,751 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 2720

--------------------
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...
3
3495
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++...
1
1709
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
1783
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
6022
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...
9
13252
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
16161
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:...
2
1882
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
1558
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
7609
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
1
7666
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
7964
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
1
5504
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...
0
5217
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...
0
3651
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...
0
3636
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2107
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
1
1208
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.