PDA

View Full Version : Visual C++ Question



31337
01-14-2003, 05:07 PM
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 http://www.opengl.org/discussion_boards/ubb/smile.gif

Old GLman
01-14-2003, 07:29 PM
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

31337
01-15-2003, 06:25 AM
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.

stodge
01-15-2003, 06:42 AM
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.

Stack Overflow
01-15-2003, 07:37 AM
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).]