wglMakeCurrent failed in MakeCurrent()

I got an error,
vtkWin32OpenGLRenderWindow (0000024A62E4C270): wglMakeCurrent failed in MakeCurrent(), error: The handle is invalid.
What is this error and how to fix it?
I create one mainwindow to display 3D model and one subwindow to display and edit 3D models.
I get the error after I finish editing and show or unshow model in mainwindow.