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 3 of 3

Thread: GDI32.dll: Access violation

Hybrid View

  1. #1
    Junior Member Newbie
    Join Date
    Dec 2004
    Posts
    4

    GDI32.dll: Access violation

    In windows 98 SE. I create "fullscreen" window with WS_EX_APPWINDOW flag. Then I choose pixel format and create OpenGL context. After window is closed I release OGL context. Very often I 1-1000 access violations in GDI32.dll. I even download some examples from internet and they operate the same way and I get the same bug. What I do wrong?
    I used GeForce FX and Radeon 9600XT video cards. And the last drivers.

  2. #2
    Senior Member OpenGL Pro
    Join Date
    Jul 2001
    Location
    France
    Posts
    1,749

    Re: GDI32.dll: Access violation

    This might best stands in the Windows specific forum.

  3. #3
    Senior Member OpenGL Pro
    Join Date
    Feb 2002
    Location
    Bonn, Germany
    Posts
    1,652

    Re: GDI32.dll: Access violation

    You should release your GL context and the device context (hdc) before calling DestroyWindow.

    Your windows class should have the CS_OWNDC style. This way you can get the device context once, immediately after creating the windows, and keep it around until you close it.

    Order matters. Initialization:
    1)CreateWindow(Ex)
    2)GetDC
    3)ChoosePixelFormat, SetPixelFormat
    4)wglCreateContext
    5)wglMakeCurrent

    Shutdown:
    1)wglMakeCurrent(0,0)
    2)wglDeleteContext
    3)ReleaseDC
    4)DestroyWindow

Posting Permissions

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