2) File/New/Project
3) Selected C++/Win32 Project, Name: OpenGlTest, Location: C:\Source Code\C++\Test, then OK
4) Hit Application Settings, checked empty project, hit Finish
5) Right mouse on the project, Add/New Item, highlighted "C++ File", Name: OpenGlTest.cpp, hit Open
6) Pasted your code in (the code from your first post).
7) Right mouse click on the project select Properties, changed the configuration to be "All Configurations"
8) In the tree select Configuration Properties/Linker/Input. In the first field "Additional Dependencies" put:
opengl32.lib glu32.lib
9) hit OK
10) Hit F5 to run. Program exits early. Tracing in the debugger shows that RegisterClassEx is failing.
11) Fix the typo at line 115:
windowClass.style = sizeof(WNDCLASSEX);
to be
memset( &windowClass, 0, sizeof(WNDCLASSEX) ); windowClass.cbSize = sizeof(WNDCLASSEX);
in addition to zero initializing the structure. I also add a windows class name that matches the one in the CreateWindow() call:
windowClass.lpszClassName = "MyClass";
12) I hit F5 and rebuild and it now runs.
[edited by - mauman on August 20, 2003 3:26:20 PM]