[vtkusers] Using Threads - wglMakeCurrent failed...

Tobias Mönch Tobias.Moench at Student.Uni-Magdeburg.DE
Fri Sep 16 13:42:33 EDT 2005


Hi everybody,

Something causes my application to crash, but I've no idea how to fix it.

What I want:
I create a simple SurfaceRendering from a 3d-dataset (vtkImageData). Thats no
problem so far. During the render window is running, i want to regularly check a
temporary file for existance and contained parameters.

What I've tried:
I created a second thread using _beginthreadex(...). In that second thread I
check for the mentioned file and so on. If something relevant is found in this
file, I want to change the transparency of the surface i.e. Therefore I defined
the vtkActor, which contains the surface, as global and change the
opacity-value. But then I'm trying to automatically update the render window
(which is also defined as global) with renWin->Render();
Vtk then gives me a message "wglMakeCurrent failed in M...." (sorry, but I'm not
able to receive more information from that window because it's always busy when
I tried to scroll).

I've also tried not to define the vtkRenderWindow as global and then pass it to
the my second thread, but then everything crashes when calling renWin->Render()
without waiting for me to read the error message ;)


1. Has anybody an idea how I could fix the "wglMakeCurrent failed"-problem?
2. Has anybody another solution or idea for what I primarily wanted?


Thank you,
Tobias



More information about the vtkusers mailing list