Mysterisou problem. What evrything can kill an OK initialized OpenGl engine ?

I am about 5 weeks triyng to solve folowing a bit mysterious problem:
I am developing a bit strange OpenGl application (Direct Show
video rendering output filter witch use OpenGl for HW acclerated video effects).
The code is based on the SampWid example from DirectX 8.1 SDK.

I correcly create an active window (in CBaseWindow classe).
I correctly asociate all the rendering context, pixelformat
and I make succesfuly several opengl output to this window (Win 98SE and
w2k enviroment).
After some time (the window is still active, no OpenGl call was made) and executing some totaly diferent procedures, the window stops to recive
OpenGl commands. glGetError returns Invalid operation.
GDI command to the same windows works O.K. …
After some time, OpenGl starts to work again correctly …
The question is, what evrything could be a reason for such behavoiur ?

Blocking the OpenGl rendering threeed by some other thred ?

Missing the focus on the correct window ?

Some Microsof protection agains using OpenGl as the part of
Direct Show technology for video procesing ?

Any idea, ofer for cooperation, desperately wanted …

[This message has been edited by husakm (edited 03-13-2002).]

As I can’t offer any help, I’ll at least offer some sympathy

The worst and most tedious part of OpenGL programming on Windows must be getting around Windows itself. I spent ten times as much effort debugging and troubleshooting that aspect as I did actually useful OpenGL work.
Buuhuuuuuu. Blame Bill.

[This message has been edited by zeckensack (edited 03-12-2002).]

Make sure you precede your OpenGL command batches with wglMakeCurrent(). A useful rule of thumb is to use wglMakeCurrent() after you’ve called PeekMessage or GetMessage, at the beginning of each callback from a window handler or MFC virtual, and (if you’re paranoid) after calls to DirectGraphics.

jawatte: it makes sense. The lose of OpenGl control happen exactly after calling
inocoent PeekMessage fucntions in the main program loop. I will try this.
Do you have any explanation why this happen ? Did you observed this behaviour
in any of your appplication ?
I am in a bit stupid situation. The code witch I am developing is an ActiveX dll
witch does not have the main message loop inside. It will be probably nessesery
to put the additional MakeCurrent call before any part of the dll using OpenGl :-(.

[This message has been edited by husakm (edited 03-13-2002).]