Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Ambiguous overload for 'wxString& = TiXmlElement*&' operator

Posted on 2004-08-23
6
Medium Priority
?
402 Views
Last Modified: 2008-02-01
I am using the wxWidgets library (formally wxWindows) and the TinyXML library.  I want to parse a value from the XML document which will serve as my User Interface structure and update the button values for the elements of the sibling nodes

The variables for the button labels are lbutton1, lbutton2, lbutton3, lbutton4, etc.

I have used the following code to parse the XML document (hopefully) correctly:

node = doc.FirstChild( "UID" );
assert( node );
uidElement = node->ToElement();
assert( uidElement );
button1 = node->ToElement();
assert ( button1 );

When I add the following line

lbutton1 = button1;


, the code will not compile and I receive the following errors:

ambiguous overload for 'wxString& = TiXmlElement*&; operator
candidates are: wxString&
             wxString&
             wxString&
             wxString&
[Build Error] [UI.o] Error 1

I am using Bloodshed Dev-C++.  It seems to be some sort of circular reference I've created...I think...
0
Comment
Question by:vivekpara
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
6 Comments
 
LVL 86

Expert Comment

by:jkr
ID: 11872470
How are 'lbutton1' and 'button1' declared?
0
 
LVL 86

Expert Comment

by:jkr
ID: 11872504
BTW, did you mean to

lbutton1 = button1->Attribute("AttributeName");
0
 
LVL 2

Author Comment

by:vivekpara
ID: 11872578
lbutton1 is declared by:

wxString ( lbutton1 );

button1 is declared
TiXmlElement* button1 = 0;

Don't know if thats what I meant...but it seems to make sense.  I'll try it.
0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
LVL 55

Assisted Solution

by:Jaime Olivares
Jaime Olivares earned 200 total points
ID: 11872620
Reading the documentation, I guess could be:
lbutton1 = button1->Value();
0
 
LVL 86

Accepted Solution

by:
jkr earned 1800 total points
ID: 11872630
The point is that you cannot just assign a 'TiXmlElement*' pointer to a 'wxstring' (see http://www.grinninglizard.com/tinyxmldocs/classTiXmlElement.html for the docs). If you want to strore an attribute in the wxstring, use

lbutton1 = button1->Attribute("AttributeName");
0
 
LVL 2

Author Comment

by:vivekpara
ID: 11872776
I will have to claim stupidity as my defense.  =)

I was cutting and pasting code and didn't notice that was a pointer.  Good call, y'all.

"You're right, you're right, I know you're right."
                            - Carrie Fisher
                            - "When Harry Met Sally"
0

Featured Post

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Errors will happen. It is a fact of life for the programmer. How and when errors are detected have a great impact on quality and cost of a product. It is better to detect errors at compile time, when possible and practical. Errors that make their wa…
This article will show you some of the more useful Standard Template Library (STL) algorithms through the use of working examples.  You will learn about how these algorithms fit into the STL architecture, how they work with STL containers, and why t…
The viewer will learn how to use the return statement in functions in C++. The video will also teach the user how to pass data to a function and have the function return data back for further processing.
The viewer will learn how to clear a vector as well as how to detect empty vectors in C++.

618 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question