[vtkusers] MFC and vtkwin32OpenGLRenderWindow

Ronald Steffen ronald.steffen at freenet.de
Sat Apr 20 06:08:42 EDT 2002


Hello vtk users,

I have a problem with my MFC application (VC 6.0) and 
vtkwin32OpenGLRenderWindow (VTK 4.0). At first I should say my 
application works fine. The only problem is that I get lot's of 
exceptions at program termination (First-chance exception in FLU3_2.exe 
(GDI32.DLL): 0xC0000005: Access Violation.). I reduced my program code 
and found that this only happens after I called the WindowInitialize() 
method like this:

void CVTKView::OnInitialUpdate()
{
    CView::OnInitialUpdate();
      this->RenderWindow->SetWindowId(this->m_hWnd);
    this->RenderWindow->WindowInitialize();
}

No other objects are created.
The destructor of my CVTKView class of course calls the Delete() method.

CVTKView::~CVTKView()
{
    if (this->Interactor)
    {
        this->Interactor->Delete();
    }
    if (this->Renderer)
    {
        this->Renderer->SetRenderWindow(NULL);
    }
    if (this->RenderWindow)
    {
        this->RenderWindow->Delete();
    }
    if (this->Renderer)
    {
        this->Renderer->Delete();
    }
}

Does anybody know something about this ?

Thanks for your help,

Ronald





More information about the vtkusers mailing list