<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<META content="MSHTML 6.00.2800.1400" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#c8e0d8>
<DIV><FONT face=Arial size=2>We have an MFC app that uses a third party&nbsp;2D 
graphics library and to make sure both use the same colors we use the following 
bit of code. The first time its gets excuted&nbsp;everything runs find but 
the&nbsp;third we get an access violation on line</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>void InitTraversal() { this-&gt;Current = 
this-&gt;Top;};</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>in vtkCollection.h</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>// create a top lookup table<BR>&nbsp;float 
rgb[4];&nbsp;<BR>&nbsp;vtkLookupTable *topLut = 
0;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<BR>&nbsp;topLut 
= vtkLookupTable::New();&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;------- crash 
here<BR>&nbsp;topLut-&gt;SetNumberOfColors(96);<BR>&nbsp;topLut-&gt;SetHueRange(0.7, 
0);<BR>&nbsp;topLut-&gt;SetSaturationRange(1, 
1);<BR>&nbsp;topLut-&gt;SetValueRange(0.8, 
1);<BR>&nbsp;topLut-&gt;Build();<BR>&nbsp;topLut-&gt;ForceBuild();<BR>&nbsp;<BR>&nbsp;int 
i, j = 0;<BR>&nbsp;for( i = 32; i &lt; 128; i++ 
)<BR>&nbsp;{<BR>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;topLut-&gt;GetTableValue(j, 
rgb);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; GSSetPal(i, rgb[0] * 255.0, rgb[1] * 
255.0, rgb[2] * 255.0);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
j++;<BR>&nbsp;}<BR>&nbsp;&nbsp;&nbsp;&nbsp;<BR>&nbsp;topLut-&gt;Delete();</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>Any ideas ?&nbsp; </FONT></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>At this point no other vtk code has been excuted. 
Is it some weird intialisation problem ?</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>Paul Tait</DIV>
<DIV><BR>&nbsp;</DIV>
<DIV>&nbsp;</DIV>
<DIV><BR>---<BR>Outgoing mail is certified Virus Free.<BR>Checked by AVG 
anti-virus system (<A 
href="http://www.grisoft.com">http://www.grisoft.com</A>).<BR>Version: 6.0.651 / 
Virus Database: 417 - Release Date: 4/5/2004</DIV></FONT></BODY></HTML>