473,388 Members | 1,286 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

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

Migrating from VC++ 6.0 to VC++ 2005

Hi,

After migrating my application from VC++ 6.0 to VC++ 2005, I receive the
error C2593 'operator +=' is ambiguous.

It refers to the following line:

Name += pManager->GetAgentName();

where Name is a string and GetAgentName also returns a string.

Please suggest.

Regards,
Arjun
May 24 '07 #1
4 2295
In article <A5**********************************@microsoft.co m>,
=?Utf-8?B?QXJqdW4=?= <Ar***@discussions.microsoft.comwrote:
>After migrating my application from VC++ 6.0 to VC++ 2005, I receive the
error C2593 'operator +=' is ambiguous.
>Name += pManager->GetAgentName();
where Name is a string and GetAgentName also returns a string.
The concept of 'string' in C++ is a very vague and overloaded
concept. Do you mean a char*, a std::string, a CString (ATL/MFC), a
tstring? [Or any other number of custom C++ string classes which may
exist in your code.] Or the unicode versions of any/all of those?

My recommendation: find out what the types *really* are in the line
you posted above. That'll usually help point you in the right
direction, as I bet you'll find that they're different.

Nathan Mates
--
<*Nathan Mates - personal webpage http://www.visi.com/~nathan/
# Programmer at Pandemic Studios -- http://www.pandemicstudios.com/
# NOT speaking for Pandemic Studios. "Care not what the neighbors
# think. What are the facts, and to how many decimal places?" -R.A. Heinlein
May 24 '07 #2
HI Nathan,

Its a CString.

CString MachineName;

Regards,
Arjun
"Nathan Mates" wrote:
In article <A5**********************************@microsoft.co m>,
=?Utf-8?B?QXJqdW4=?= <Ar***@discussions.microsoft.comwrote:
After migrating my application from VC++ 6.0 to VC++ 2005, I receive the
error C2593 'operator +=' is ambiguous.
Name += pManager->GetAgentName();
where Name is a string and GetAgentName also returns a string.

The concept of 'string' in C++ is a very vague and overloaded
concept. Do you mean a char*, a std::string, a CString (ATL/MFC), a
tstring? [Or any other number of custom C++ string classes which may
exist in your code.] Or the unicode versions of any/all of those?

My recommendation: find out what the types *really* are in the line
you posted above. That'll usually help point you in the right
direction, as I bet you'll find that they're different.

Nathan Mates
--
<*Nathan Mates - personal webpage http://www.visi.com/~nathan/
# Programmer at Pandemic Studios -- http://www.pandemicstudios.com/
# NOT speaking for Pandemic Studios. "Care not what the neighbors
# think. What are the facts, and to how many decimal places?" -R.A. Heinlein
May 24 '07 #3
In article <8D**********************************@microsoft.co m>,
=?Utf-8?B?QXJqdW4=?= <Ar***@discussions.microsoft.comwrote:
>After migrating my application from VC++ 6.0 to VC++ 2005, I receive the
error C2593 'operator +=' is ambiguous.
>Name += pManager->GetAgentName();
where Name is a string and GetAgentName also returns a string.
> The concept of 'string' in C++ is a very vague and overloaded
concept. Do you mean a char*, a std::string, a CString (ATL/MFC), a
tstring? [Or any other number of custom C++ string classes which may
exist in your code.] Or the unicode versions of any/all of those?
> My recommendation: find out what the types *really* are in the
line you posted above. That'll usually help point you in the right
direction, as I bet you'll find that they're different.
>Its a CString.
CString MachineName;
First, don't top-post. English is read left-to-right,
top-to-bottom. Trim off your replies to be just what you're
responding to.

Next, why bring up 'MachineName' when is not found in the code
snippet you gave above -- it's 'Name' and whatever GetAgentName()
returns. Also, note that I said to investigate the type*S* in that
line. Not 'type'. Plural. In your line about 'Name +=
blah->GetAgentName()', you need to look into the type*S* of the left
and right sides of that.

Nathan Mates
--
<*Nathan Mates - personal webpage http://www.visi.com/~nathan/
# Programmer at Pandemic Studios -- http://www.pandemicstudios.com/
# NOT speaking for Pandemic Studios. "Care not what the neighbors
# think. What are the facts, and to how many decimal places?" -R.A. Heinlein
May 24 '07 #4

"Nathan Mates" <na****@visi.comwrote in message
news:13*************@corp.supernews.com...
In article <8D**********************************@microsoft.co m>,
=?Utf-8?B?QXJqdW4=?= <Ar***@discussions.microsoft.comwrote:
>>After migrating my application from VC++ 6.0 to VC++ 2005, I receive
the
error C2593 'operator +=' is ambiguous.
>>Name += pManager->GetAgentName();
where Name is a string and GetAgentName also returns a string.
>> The concept of 'string' in C++ is a very vague and overloaded
concept. Do you mean a char*, a std::string, a CString (ATL/MFC), a
tstring? [Or any other number of custom C++ string classes which may
exist in your code.] Or the unicode versions of any/all of those?
>> My recommendation: find out what the types *really* are in the
line you posted above. That'll usually help point you in the right
direction, as I bet you'll find that they're different.
>>Its a CString.
CString MachineName;

First, don't top-post. English is read left-to-right,
top-to-bottom. Trim off your replies to be just what you're
responding to.

Next, why bring up 'MachineName' when is not found in the code
snippet you gave above -- it's 'Name' and whatever GetAgentName()
returns. Also, note that I said to investigate the type*S* in that
line. Not 'type'. Plural. In your line about 'Name +=
blah->GetAgentName()', you need to look into the type*S* of the left
and right sides of that.
Of course, this is SO fundamental to solving a "ambiguous function" error
that the compiler really should have told you that, along with the possible
matches it found. In fact, I think VC++ 2005 does exactly that.

Please cut+paste the following few lines from the compiler output, where it
gives the argument types along with the candidate functions.
>
Nathan Mates
--
<*Nathan Mates - personal webpage http://www.visi.com/~nathan/
# Programmer at Pandemic Studios -- http://www.pandemicstudios.com/
# NOT speaking for Pandemic Studios. "Care not what the neighbors
# think. What are the facts, and to how many decimal places?" -R.A.
Heinlein

May 24 '07 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: Shai Levi | last post by:
Hi, I'm trying to migrate native c++ class to managed c++ class. The native class header definition looks as: class NativeClass { public: typedef void (CbFunc1)(int n,void* p);
1
by: Steve | last post by:
We are considering the ways to migrate our VC++ 6.0 applications to .NET platform. It would be nice to rewrite them completely in C#, but due to the time constraints this option is out of...
3
by: Mike Doyle | last post by:
Hi, I'm looking at migrating our existing from Visual Studio (6.00) C++ code to the .NET version of C++ (unmanaged) Can anyone point me towards documention or an overview of this ? Thanks in...
8
by: david_75 | last post by:
I wonder if the transistion from the project written in VC++ 6.0 to VC++ .NET requires a lot of code changes (if any) if I compile the project in native code (or unmanaged code) without using the...
11
by: danip | last post by:
Hi there, I need to do the following: 1. Migrate a whole solution (with tens of projects) from VC 6.0 to VC 8.0. The project has a lot of MFC templates like CArray, and many error are poping out,...
3
by: Dietmar Marek | last post by:
Hi folks, I just converted my C#/C++ 2003 solution to 2005. The conversion of all 31 projects worked fine, but I can't start it now. It tells me: "Can't start 'xxx.exe' or one of its...
6
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...
34
by: subramanian100in | last post by:
Is there any difference between porting and migrating. Kindly explain
4
by: VikrantS | last post by:
Hi, I am migrating code from VS 6.0 to VS2008. The Code compiles in VS 6.0 but gives the following errors when compiled in VS 2008, --- \Program Files\VC\atlmfc\include\afxcmn.inl(376) : error...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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...
0
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,...
0
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...

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.