>> >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
Ben Voigt - 24 May 2007 22:39 GMT
>>> >After migrating my application from VC++ 6.0 to VC++ 2005, I receive
>>> >the
[quoted text clipped - 25 lines]
> 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
> --
[quoted text clipped - 3 lines]
> # think. What are the facts, and to how many decimal places?" -R.A.
> Heinlein