PDA

View Full Version : OpenGL ActiveX Control



mohancusat
02-18-2004, 06:06 AM
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.

mariuss
02-18-2004, 08:30 AM
Make sure that the
window class for your drawing
has CS_OWNDC style. It may help.

Korval
02-18-2004, 10:38 AM
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.

mariuss
02-18-2004, 01:16 PM
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

jwatte
02-18-2004, 02:14 PM
Suggestion: Create child window and attach to your container. Make this child window have CS_OWNDC. Create OpenGL context in that child window.

V-man
02-18-2004, 05:10 PM
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.

mohancusat
02-23-2004, 06:59 AM
[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????

mohancusat
02-23-2004, 07:02 AM
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....