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: creating context, opengl drawing(Visual Studio 6)

  1. #1
    Junior Member Newbie
    Join Date
    Oct 2008
    Posts
    4

    creating context, opengl drawing(Visual Studio 6)

    Hi,
    I have two applications. First one (let's say A) draws opengl objects on the window of second application(let's say B). Thread of A creates opengl context using the handle to device context of window of B. when closing A, I am calling wglMakeCurrent(NULL,NULL). Then, ReleaseDC and wglDeleteContext are called in order. B is still running. Then, I am running A again, which makes my computer crash. But, this code runs properly in some of other computers. To run my applications properly, when I stop running A, I have to stop B too. Then I have to run both of them again. What can be the problem? My computer crashes wglMakeCurrent call in the second run of A(while B is runnnig).

  2. #2
    Intern Newbie
    Join Date
    Aug 2008
    Posts
    35

    Re: creating context, opengl drawing(Visual Studio 6)

    when closing A, I am calling wglMakeCurrent(NULL,NULL). Then, ReleaseDC and wglDeleteContext are called in order.

    -- try wglDeleteContext before ReleaseDC?

  3. #3
    Junior Member Newbie
    Join Date
    Oct 2008
    Posts
    4

    Re: creating context, opengl drawing(Visual Studio 6)

    I tried, but it didn't work.

    Actually, after wglMakeCurrent(NULL,NULL) is called, GetLastError() returns 6 (ERROR_INVALID_HANDLE).Also, after wglDeleteContext is called, GetLastError() returns 170 (ERROR_BUSY).(Visual Studio 6)

    Can the problem occur because of these errors?

Posting Permissions

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