Note that there are some explanatory texts on larger screens.

plurals
  1. POGetter and setter wrappers for TiXmlElement*'s
    primarykey
    data
    text
    <p>I am rewriting a project so that it uses getters and setters to reference the TiXmlElement *'s However, I quickly run into problems that seem to be related to debug mode:</p> <p>Ecxerpt from my class's header:</p> <pre><code>TiXmlElement *_rootElement; TiXmlElement *_dialogsElement; TiXmlElement *_dialogElement; TiXmlDocument _document; void setDocument (TiXmlDocument doc) { this-&gt;_document = doc; } void setRootElement (TiXmlElement * element) { this-&gt;_rootElement = element; } void setDialogsElement (TiXmlElement * element) { this-&gt;_dialogsElement = element; } TiXmlDocument getDocument () { return this-&gt;_document; } TiXmlElement* getRootElement () { return this-&gt;_rootElement; } TiXmlElement* getDialogsElement () { return this-&gt;_dialogsElement; } </code></pre> <p>Excerpt from class constructor:</p> <pre><code>DCXML::DCXML(const char *dialogMark,const char *dialogName,TiXmlDocument doc) { ... this-&gt;setDocument(doc); this-&gt;setRootElement(this-&gt;getDocument().FirstChildElement("dcxml")); this-&gt;setDialogsElement(this-&gt;getRootElement()-&gt;FirstChildElement("dialogs")); </code></pre> <p>Excerpt from instantiating the class:</p> <pre><code>TiXmlDocument doc(input.gettok(2,"\"").to_chr()); bool dcxmlFile = doc.LoadFile(); ... DCXML *dcxml = new DCXML(input.gettok(2).to_chr(),input.gettok(3).to_chr(),doc); </code></pre> <p>Now for the weird part. This works up until</p> <pre><code>this-&gt;setDialogsElement(this-&gt;getRootElement()-&gt;FirstChildElement("dialogs")); </code></pre> <p>in the constructor.</p> <p>->FirstChildElement("dialogs") throws an "CXX0039: Error: symbol is ambiguous" error in VS2008 when in debug mode.</p> <p>The weird part is IntelliSense picks up on the FirstChildElement method and the compiler doesn't throw any errors.</p> <p>What's even weirder is that when in release mode it just fails silently to get the dialogs element.</p> <p>What I am doing wrong ? Or if you have succesfully implemented getter setter wrappers for TiXmlElement*'s let me know how I can as well!.</p> <p>For complete reference here's an excerpt from the XML file:</p> <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt; &lt;dcxml&gt; &lt;dialogs&gt; &lt;dialog name="mediaplayer" center="" w="300" h="400" caption="Mamp 4.0 BETA" border="btmnzy"&gt; &lt;/dialog&gt; &lt;/dialogs&gt; &lt;/dcxml&gt; </code></pre> <p>Feedback would be much appreciated as I am at a dead end :)</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload