<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<meta name="Generator" content="Microsoft Exchange Server">
<!-- converted from rtf -->
<style><!-- .EmailQuote { margin-left: 1pt; padding-left: 4pt; border-left: #800000 2px solid; } --></style>
</head>
<body>
<font face="Calibri, sans-serif" size="2">
<div>Hi !</div>
<div> </div>
<div>I am having some strange problem using vtkAxis->SetTitle() from the new charts API.</div>
<div>After the second of the following lines an exception occurs:</div>
<div> </div>
<div> <font face="Courier New, monospace" size="2">temp = XAxisName->c_str();</font></div>
<div> <font face="Courier New, monospace" size="2">Xaxis->SetTitle(temp); </font><font face="Courier New, monospace" size="2" color="#008000">// title of axis</font></div>
<div><font color="#008000"> </font></div>
<div>Temp is of type vtkStdString and Xaxis of type vtkSmartPointer<vtkAxis> (although the behavior is essentially the same when I make Xaxis as a direct vtkAxis without any smart pointers).</div>
<div>I checked that the value of temp at this point is well defined (“TestX”), and I can trace further until I arrive at </div>
<div><font face="Courier New, monospace" size="2" color="#0000FF">void<font color="#000000"> vtkAxis::SetTitle(</font>const<font color="#000000"> vtkStdString &title)</font></font></div>
<div><font face="Courier New, monospace" size="2">{</font></div>
<div><font face="Courier New, monospace" size="2"> <font color="#0000FF">if</font> (<font color="#0000FF">this</font>->Title != title)</font></div>
<div><font face="Courier New, monospace" size="2"> {</font></div>
<div><font face="Courier New, monospace" size="2"> <font color="#0000FF">this</font>->Title = title;</font></div>
<div><font face="Courier New, monospace" size="2"> <font color="#0000FF">this</font>->Modified();</font></div>
<div><font face="Courier New, monospace" size="2"> }</font></div>
<div><font face="Courier New, monospace" size="2">}</font></div>
<div> </div>
<div>, which is defined in vtkAxis.cxx. The exception occurs when trying to execute the line <font face="Courier New, monospace" size="2" color="#0000FF">this</font><font face="Courier New, monospace" size="2">->Title = title;</font></div>
<div>The odd thing – already indicating that something goes wrong – is that “title” seems to point four bytes before the right string and seems to be much longer; i.e. it shows XXXXTestXXXXXX…, where X is some arbitrary garbage byte.</div>
<div> </div>
<div>I am using Visual Studio 2008 on Win XP and get an exception message stating some memory corruption.</div>
<div> </div>
<div>Does anybody has a clue what’s going on here ? If I remove calls to SetTitle (I have two of them in my app), everything seems to run smoothly (apart from the missing labels of course).</div>
<div> </div>
<div>Daniel</div>
<div> </div>
</font>
</body>
</html>