[vtkusers] kernel32.dll error with VTK 5.0 and 5.0.2 in vtkInformationStringKey::Set

echinococcus Multilocularis lintworm2 at yahoo.co.uk
Sat Oct 21 04:13:47 EDT 2006


The first thing that i saw was the construction of the vtkInformationStringValue pointer:

vtkInformationStringValue* v = new vtkInformationStringValue;

while you use the vtk Delete():

v->Delete();

Shouldn't this be:

vtkInformationStringValue* v = vtkInformationStringValue::New();
.
.
.
.
v->Delete();

I am not sure, i don't have documentation on me right now, so if i'm saying stupid things: Sorry for that... :)

cheers, Han



----- Original Message ----
From: Andres Barrera <andresba at hotmail.com>
To: vtk-developers at vtk.org; vtkusers at vtk.org
Sent: Friday, 20 October, 2006 10:18:03 PM
Subject: [vtkusers] kernel32.dll error with VTK 5.0 and 5.0.2 in vtkInformationStringKey::Set


Can anyone help me with this error?

I’m not being able to run even a simple program using neither VTK 5.0 nor 
VTK 5.0.2.
(Using VTK 5.0 and VTK 5.0.2, CMake 2.0 Patch 6, and C++Builder 5)

I successfully built both VTK versions and compiled with no errors a simple 
test code (see below), but at run time the program crashes on an error:

“Access violation at address 7C8……… in module ‘kernel32.dll’. Write of 
address 0055……”

While debugging the error seams to be fired by line ‘v->Value = value;’ at: 
'void vtkInformationStringKey::Set(vtkInformation* info, const char* value)'

   Any ideas/suggestions?

    Thanks in advance

        Andres


VTK CODE: (that fires the error)
----------------
void vtkInformationStringKey::Set(vtkInformation* info, const char* value)
{
  if(value)
    {
    vtkInformationStringValue* v = new vtkInformationStringValue;
    this->ConstructClass("vtkInformationStringValue");
    v->Value = value;
    this->SetAsObjectBase(info, v);
    v->Delete();
    }
  else
    {
    this->SetAsObjectBase(info, 0);
    }
}


SAMPLE CODE:
-------------------
  vtkConeSource *cone = vtkConeSource::New();

  cone->SetHeight( 3.0 );
  cone->SetRadius( 1.0 );
  cone->SetResolution( 10 );

  vtkPolyDataMapper *coneMapper = vtkPolyDataMapper::New();
    coneMapper->SetInputConnection( cone->GetOutputPort() );

  vtkActor *coneActor = vtkActor::New();
    coneActor->SetMapper( coneMapper );

  vtkRenderer *ren1= vtkRenderer::New();
    ren1->AddActor( coneActor );
    ren1->SetBackground( 0.1, 0.2, 0.4 );

  vtkRenderWindow *renWin = vtkRenderWindow::New();
    renWin->AddRenderer( ren1 );
    renWin->SetSize( 300, 300 );

    renWin->Render();

  // Add cleanup using Delete()

_________________________________________________________________
Stay in touch with old friends and meet new ones with Windows Live Spaces 
http://clk.atdmt.com/MSN/go/msnnkwsp0070000001msn/direct/01/?href=http://spaces.live.com/spacesapi.aspx?wx_action=create&wx_url=/friends.aspx&mkt=en-us

_______________________________________________
This is the private VTK discussion list. 
Please keep messages on-topic. Check the FAQ at: http://www.vtk.org/Wiki/VTK_FAQ
Follow this link to subscribe/unsubscribe:
http://www.vtk.org/mailman/listinfo/vtkusers

Send instant messages to your online friends http://uk.messenger.yahoo.com 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20061021/0cb78719/attachment.htm>


More information about the vtkusers mailing list