OpenGL ActiveX Control

Hi,
Please help me…in this problem

When I place two or more ActiveX controls made using opengl, they behave completely indifferent. It seems they all share the same DC. CAn any one suggets a remedy soon??? It will of great help for me.

Make sure that the
window class for your drawing
has CS_OWNDC style. It may help.

ActiveX controls frequently do not have ownership of their HWND (and therefore their HDC and HRC). Usually, they share the HWND of the code that created them. As such, two ActiveX controls in the same window will use the same HWND.

Why you dont use a compositte control ?
Ot I’ve just browsed there, use for your
activeX a ‘static’ control, than create your
own opngl widow as a child of this one.
Then you have your own dc/hwnd

Suggestion: Create child window and attach to your container. Make this child window have CS_OWNDC. Create OpenGL context in that child window.

You need to create that child window in its own thread or create each control in its own thread.

ActiveX controls run in the same process space so if one calls wglMakeCurrent, it steals the rendering ability of the other.

[QUOTE]Originally posted by Korval:
Hi, Thanks for the reply…But what is the way to fet around the problem of using the same Hwnd???

Originally posted by mariuss:
Why you dont use a compositte control ?
Ot I’ve just browsed there, use for your
activeX a ‘static’ control, than create your
own opngl widow as a child of this one.
Then you have your own dc/hwnd

Thanks for the reply…But I didnt get you!!! How to make the activeX a static control…??? If u know some sites related to this, mail me…