Visual C++ Question

I created a openGL project thats a command line program but now I am changing my basecode from GLFW to windows.h. So naturally I need to use WinMain() instead of main(). How do I change this in Visual C++ 6.0?

How is this related to GL? I’m doing this for a GL project

To use Win32 as your basecode you just create a Win 32 Application under the projects tab in MSVC++. It’s not really related to OpenGL, but to see how to setup your basecode to use OpenGL, look to Nehe lesson #1.

Old GLman

I was just wondering if it was possible to change it to a win32 app without taking all of the code and plugging it into a new project.

Open the project settings and look for the “Project Settings” box under the C++ tab. There may (should?) be a /subsystem option displayed in this box. If there is, change it to /subsystem:Windows or /subsystem:window. You’ll have to experiment as I can’t remember offhand what the real value should be. Failing that search Google for subsystem and visual studio and see what comes back.

You’ll need to add in your Windows specific code and change the main to WinMain.

Hello 31337,

Try The Following:

/* Global Variable */

/////
int WINAPI WinMain( HINSTANCE, HINSTANCE, LPSTR, int );
/////

/* Main Function */

int WINAPI WinMain( HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow ) {

// Your main() code goes here

return true;
}

Hope this Helps.

  • VC6-OGL

[This message has been edited by VC6-OGL (edited 01-15-2003).]