From: DanB on 27 Feb 2010 21:12 DanB wrote: > Now I have new information. By doing some extra tracing into vector, I > noticed two different assignment operators for the first and second > call. I asked myself how that could be? So then I saw I had two vector > headers open!??! > > In the first call: > XMLNODESET nodeset= xml.GetNodeSet( "//*/test" ); > > I land in the 2003 7.1 header <vector>. And here: > > nodeset= xml.GetNodeSet( "//*/subStuff/testing[@type=1]" ); > > I'm in the 9.0 header <vector>. > > Both these lines are in the same function of the CView test app not far > from each other, so I'm baffled. The tracing stays in the right places > in either header and all the trace info is correct in both files. Just to be clear, the line numbers are far apart. In <vector> 7.1 _Myt& operator=(const _Myt& _Right) is on line 391 In <vector> 9.0 _Myt& operator=(const _Myt& _Right) is on line 562 The tracing is in the right place as I trace into the two files!? > Twilight Zone music starts here for me... Thanks, Dan.
From: Giovanni Dicanio on 28 Feb 2010 05:32 "DanB" <abc(a)some.net> ha scritto nel messaggio news:tfjin.133$QL4.45(a)newsfe24.iad... > In the first call: > XMLNODESET nodeset= xml.GetNodeSet( "//*/test" ); > > I land in the 2003 7.1 header <vector>. And here: > > nodeset= xml.GetNodeSet( "//*/subStuff/testing[@type=1]" ); > > I'm in the 9.0 header <vector>. So different mismatching STL vector implementations are used. > BTW, I have the whole solution, 7.1 version, here: > > http://lakeweb.net/MFC/downloads/xml.zip It seems to me that file "xml.h" misses from the zip... Giovanni
From: DanB on 28 Feb 2010 11:04 Giovanni Dicanio wrote: > "DanB" <abc(a)some.net> ha scritto nel messaggio > news:tfjin.133$QL4.45(a)newsfe24.iad... > >> In the first call: >> XMLNODESET nodeset= xml.GetNodeSet( "//*/test" ); >> >> I land in the 2003 7.1 header <vector>. And here: >> >> nodeset= xml.GetNodeSet( "//*/subStuff/testing[@type=1]" ); >> >> I'm in the 9.0 header <vector>. > > So different mismatching STL vector implementations are used. Yes Giovanni, But that should be impossible! Should it not? >> BTW, I have the whole solution, 7.1 version, here: >> >> http://lakeweb.net/MFC/downloads/xml.zip > > It seems to me that file "xml.h" misses from the zip... I'm sorry, this one should be right. <http://lakeweb.net/MFC/xml.h> And maybe this library will be useful for you. I've been using it for many years. Thanks, Dan.
From: Goran on 28 Feb 2010 12:39 On Feb 26, 11:44 pm, DanB <a...(a)some.net> wrote: > Well I finally bought the new 2008 VS. I'm moving carefully over as I > have to keep a 7.1 build current. I'm moving my support first as I don't > have to keep it updated. I started with that hexml project. > > When I get to this as a copy constructor: > > XMLNODESET::XMLNODESET( XMLNODESET& inSet ) > { > *this= inSet; > > } > > dec: > class HE_XML_EXT_CLASS XMLNODESET > { > private: > std::vector<TiXmlNode*> set; > ... > > }; > > The pointer to the vector is copied now where as in 7.1 it would do a > deep copy of the vector. You are mistaken, "deep" copy was never done for a vector like yours (I assume that by "deep" you mean copies of TiXmlNode were created on the heap when copying a vector using it's operator=). If you still think that was the case, post sample code here so that we can compare. That said, you might need to look at your XMLNODESET& operator= and you really should change your input param to const XMLNODESET& (note "const"). Goran.
From: DanB on 28 Feb 2010 13:46 Goran wrote: > On Feb 26, 11:44 pm, DanB<a...(a)some.net> wrote: >> Well I finally bought the new 2008 VS. I'm moving carefully over as I >> have to keep a 7.1 build current. I'm moving my support first as I don't >> have to keep it updated. I started with that hexml project. >> >> When I get to this as a copy constructor: >> >> XMLNODESET::XMLNODESET( XMLNODESET& inSet ) >> { >> *this= inSet; >> >> } >> >> dec: >> class HE_XML_EXT_CLASS XMLNODESET >> { >> private: >> std::vector<TiXmlNode*> set; >> ... >> >> }; >> >> The pointer to the vector is copied now where as in 7.1 it would do a >> deep copy of the vector. > > You are mistaken, "deep" copy was never done for a vector like yours > (I assume that by "deep" you mean copies of TiXmlNode were created on > the heap when copying a vector using it's operator=). Yes, my language was inadequate. > That said, you might need to look at your XMLNODESET& operator= and > you really should change your input param to const XMLNODESET& (note > "const"). I've done it both ways and even removed it completely so it is now implicit. This was one of those time, (really old code), where I had not use the const. But the problem I'm chasing doesn't seem to have anything to do with this constructor. It is that the code is not consistent from copy to assignment. It is a simple class, it can be seen here: <http://lakeweb.net/MFC/xml.h> As you read through my posts, you will see where I'm at with this. Thanks, Dan.
First
|
Prev
|
Next
|
Last
Pages: 1 2 3 4 5 Prev: Excel automation to an already open XLS Next: Clear CWnd Child with png |