<!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 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 everything runs find but
the third we get an access violation on line</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>void InitTraversal() { this->Current =
this->Top;};</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>in vtkCollection.h</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>// create a top lookup table<BR> float
rgb[4]; <BR> vtkLookupTable *topLut =
0; <BR> topLut
= vtkLookupTable::New(); <------- crash
here<BR> topLut->SetNumberOfColors(96);<BR> topLut->SetHueRange(0.7,
0);<BR> topLut->SetSaturationRange(1,
1);<BR> topLut->SetValueRange(0.8,
1);<BR> topLut->Build();<BR> topLut->ForceBuild();<BR> <BR> int
i, j = 0;<BR> for( i = 32; i < 128; i++
)<BR> {<BR> topLut->GetTableValue(j,
rgb);<BR> GSSetPal(i, rgb[0] * 255.0, rgb[1] *
255.0, rgb[2] * 255.0);<BR>
j++;<BR> }<BR> <BR> topLut->Delete();</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>Any ideas ? </FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </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> </DIV>
<DIV><FONT face=Arial size=2>Paul Tait</DIV>
<DIV><BR> </DIV>
<DIV> </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>