MantisBT - VTK
View Issue Details
0000482VTK(No Category)public2004-01-05 16:222016-08-12 09:54
Mathieu Malaterre 
Dave DeMarle 
urgentmajoralways
closedmoved 
 
 
0000482: Bug in SetRenderWindow(NULL) => still a bug
As reported by Dean Inglis, there is a bug in vtkWin32OpengRenderWindow that is reproducable when using borland's VCL. A call to MakeCurrent is producing error:

ERROR: In c:\Builder\Sources\VTK\Rendering\vtkWin32OpenGLRenderWindow.cxx, line 220
vtkWin32OpenGLRenderWindow (01A9F02C): wglMakeCurrent failed in MakeCurrent(), error: The handle is invalid.
No tags attached.
Issue History
2008-11-30 09:19Mathieu MalaterreStatus@30@ => tabled
2008-11-30 09:19Mathieu MalaterreAssigned ToMathieu Malaterre => David Cole
2011-01-19 10:09David ColeAssigned ToDavid Cole =>
2011-06-16 13:11Zack GalbreathCategory => (No Category)
2013-06-05 17:15Jean-Christophe Fillion-RobinNote Added: 0030945
2013-07-22 19:11Dave DeMarleNote Added: 0031214
2013-07-22 19:11Dave DeMarleStatusbacklog => expired
2013-07-22 19:11Dave DeMarleAssigned To => Dave DeMarle
2016-08-12 09:54Kitware RobotNote Added: 0036706
2016-08-12 09:54Kitware RobotStatusexpired => closed
2016-08-12 09:54Kitware RobotResolutionopen => moved

Notes
(0000581)
Mathieu Malaterre   
2004-01-28 14:23   
Ok this error was also reproducible on python:

http://vtk.org/pipermail/vtkusers/2004-January/021857.html [^]

ello,
I have updated my vtkWin32OpenGLRenderWindow (lines where not the same at all). My app doesn\'t crash anymore but I have a VTK error instead :
 
wglMakeCurrent failed in MakeCurrent(), error: Invalid descriptor
wglMakeCurrent failed in Clean(), error: 6
 
Here is the location :
 
void vtkWin32OpenGLRenderWindow::MakeCurrent()
{
  // Try to avoid doing anything (for performance).
  HGLRC current = wglGetCurrentContext();
  if (this->ContextId != current)
    {
    if(this->IsPicking && current)
      {
      vtkErrorMacro(\"Attempting to call MakeCurrent for a different window\"
                    \" than the one doing the picking, this can causes crashes\"
                    \" and/or bad pick results\");
      }
    else
      {
      if (wglMakeCurrent(this->DeviceContext, this->ContextId) != TRUE)
        {
        LPVOID lpMsgBuf;
        ::FormatMessage(
          FORMAT_MESSAGE_ALLOCATE_BUFFER |
          FORMAT_MESSAGE_FROM_SYSTEM |
          FORMAT_MESSAGE_IGNORE_INSERTS,
          NULL,
          GetLastError(),
          MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), // Default language
          (LPTSTR) &lpMsgBuf,
          0,
          NULL
          );
        vtkErrorMacro(\"wglMakeCurrent failed in MakeCurrent(), error: \"
                      << (LPCTSTR)lpMsgBuf);
        ::LocalFree( lpMsgBuf );
        }
      }
    }
}

 
called in vtkWin32OpenGLRenderWindow::Clean()
 
    if (wglMakeCurrent(NULL, NULL) != TRUE)
      {
      vtkErrorMacro(\"wglMakeCurrent failed in Clean(), error: \" << GetLastError());
      }


(0030945)
Jean-Christophe Fillion-Robin   
2013-06-05 17:15   
Does the problem still occur with VTK 5.10 ? VTK 6 ?
(0031214)
Dave DeMarle   
2013-07-22 19:11   
If the bug persists in 6.0, please reopen.
(0036706)
Kitware Robot   
2016-08-12 09:54   
Resolving issue as `moved`.

This issue tracker is no longer used. Further discussion of this issue may take place in the current VTK Issues page linked in the banner at the top of this page.