Search

OpenGL in MFC application does not work in Windows 8 64 bit by BongoVR

Active

2
0
Sign in
to vote
Type: Bug
ID: 780757
Opened: 3/5/2013 10:22:56 PM
Access Restriction: Public
0
Workaround(s)
1
User(s) can reproduce this bug
In an MFC project which uses OpenGL the call to wglMakeCurrent fails and GetLastError returns 6 (Invalid Handle). Thus, no OpenGL can be used.
This happens only in 64 bit mode under Windows 8. With Windows 7 64 bit the code runs fine. The 32 bit executable runs fine in all OSes.
Details (expand)

Visual Studio/Team Foundation Server/.NET Framework Tooling Version

Visual Studio 2012

What category (if any) best represents this feedback?

 

Steps to reproduce

1) Download Visual Studio 2008 samples
2) Open cube.sln
3) Transform into VS2012 format and confirm everything
4) Build 32 bit executable
5) Run (-> everything is fine)
6) Switch to x64 platform and build
7) Run (-> crash)

Product Language

German

Operating System

Windows 8

Operating System Language

German

Actual results

When the 64 bit version is executed in the debugger, the call to wglMakeCurrent in Cubeview.cpp (line 249) always returns FALSE. GetLastError returns 6.

Expected results

wglMakeCurrent should return TRUE.

Locale

 
File Attachments
File Name Submitted By Submitted On File Size  
cube.7z 3/6/2013 19 KB
Sign in to post a comment.
Posted by BongoVR on 6/18/2013 at 7:36 AM
Some news about the issue.
I have also experimented with a pure Win32 project with OpenGL and observed the same behaviour. So, yes, it is not an issue of MFC.

However, when compiling the same programme for x64 using Visual Studio 2010 and running the executable under Windows 8 it worked. The main difference therefore is the C runtime library. The one shipping with Visual Studio 2012 is to blame. There is no other difference because the opengl32.dll is the very same.

Any update on this issue?
Posted by BongoVR on 4/12/2013 at 12:55 AM
Thanks for your response. I have posted this issue in the forum you mentioned but not received answers so far. I also do not believe that this is an MFC bug. wglMakeCurrent gets a valid handle and always returns false - so the problem is in that function. Since this happens only in Windows 8 64 bit with the VERY SAME binary executable that works with Windows 7 64 bit just fine I strongly suppose that this is a bug introduced with Windows 8.
Since the bug is reproducible with the CubeView sample you can investigate the issue together with the Windows team. Please understand that this is sample code from Microsoft showing how to use OpenGL. Now, with Windows 8 this code does not work any more. How should developers set up OpenGL now? Are there any recommendations about how to initialise OpenGL in Windows 8 any differently than in previous OS versions?
Posted by Microsoft on 4/8/2013 at 11:52 AM
Hello,

Thanks for the report. We have investigated and we do not believe that this is an MFC bug. We recommend you check with OpenGL or with Windows (http://social.msdn.microsoft.com/forums/en-US/windowssdk/threads/).

Pat Brenner
Visual C++ Libraries Development
Posted by jakka30 on 3/14/2013 at 1:41 PM
We could reproduce the same issue with our application which is being built using MFC, OpenGL.
Posted by Microsoft on 3/14/2013 at 3:03 AM
Thanks for your response. Your issue has been routed to the appropriate VS development team for investigation. We will contact you if we require any additional information.
Posted by BongoVR on 3/6/2013 at 2:51 AM
Please find attached project file. In cubeview.cpp, line 251, I always receive 6 for 64 bit builds under Windows 8.
Posted by Microsoft on 3/6/2013 at 2:19 AM
Hi BongoVR, thank you for submitting feedback on Visual Studio and .NET Framework. Could you upload your sample project please? Thanks.
Posted by Microsoft on 3/5/2013 at 10:51 PM
Thank you for your feedback, we are currently reviewing the issue you have submitted. If this issue is urgent, please contact support directly(http://support.microsoft.com)
Sign in to post a workaround.