Part of the Khronos Group
OpenGL.org

The Industry's Foundation for High Performance Graphics

from games to virtual reality, mobile phones to supercomputers

Results 1 to 8 of 8

Thread: OpenGL ActiveX Control

  1. #1
    Junior Member Newbie
    Join Date
    Feb 2004
    Location
    India
    Posts
    3

    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.

  2. #2
    Junior Member Newbie
    Join Date
    Jan 2004
    Location
    RIchmond Hill, ON,Canada
    Posts
    5

    Re: OpenGL ActiveX Control

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

  3. #3
    Senior Member OpenGL Guru
    Join Date
    Mar 2001
    Posts
    3,576

    Re: OpenGL ActiveX Control

    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.

  4. #4
    Junior Member Newbie
    Join Date
    Jan 2004
    Location
    RIchmond Hill, ON,Canada
    Posts
    5

    Re: OpenGL ActiveX Control

    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

  5. #5
    Senior Member OpenGL Guru
    Join Date
    Mar 2001
    Posts
    2,411

    Re: OpenGL ActiveX Control

    Suggestion: Create child window and attach to your container. Make this child window have CS_OWNDC. Create OpenGL context in that child window.
    "If you can't afford to do something right,
    you'd better make sure you can afford to do it wrong!"

  6. #6
    Super Moderator OpenGL Guru
    Join Date
    Feb 2000
    Location
    Montreal, Canada
    Posts
    4,256

    Re: OpenGL ActiveX Control

    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.
    ------------------------------
    Sig: http://glhlib.sourceforge.net
    an open source GLU replacement library. Much more modern than GLU.
    float matrix[16], inverse_matrix[16];
    glhLoadIdentityf2(matrix);
    glhTranslatef2(matrix, 0.0, 0.0, 5.0);
    glhRotateAboutXf2(matrix, angleInRadians);
    glhScalef2(matrix, 1.0, 1.0, -1.0);
    glhQuickInvertMatrixf2(matrix, inverse_matrix);
    glUniformMatrix4fv(uniformLocation1, 1, FALSE, matrix);
    glUniformMatrix4fv(uniformLocation2, 1, FALSE, inverse_matrix);

  7. #7
    Junior Member Newbie
    Join Date
    Feb 2004
    Location
    India
    Posts
    3

    Re: OpenGL ActiveX Control

    [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????

  8. #8
    Junior Member Newbie
    Join Date
    Feb 2004
    Location
    India
    Posts
    3

    Re: OpenGL ActiveX Control

    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....

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •