Jump to content
  • Advertisement
Sign in to follow this  
alfa2

Help Please ! !

This topic is 4802 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I'm a beginner to C++ and DirectX This is a great community ! ! ! This is my code :: // Include the Windows header file that’s needed for all Windows applications #include <windows.h> HINSTANCE hInst; // global handle to hold the application instance HWND wndHandle; // global variable to hold the window handle // forward declarations bool initWindow( HINSTANCE hInstance ); LRESULT CALLBACK WndProc( HWND, UINT, WPARAM, LPARAM ); // This is winmain, the main entry point for Windows applications int WINAPI WinMain( HINSTANCE hInstance, HINSTANCE hPrevInstance, LPTSTR lpCmdLine, int nCmdShow ) { "This is line 16 !!!!!!!!!!" // Initialize the window if ( !initWindow( hInstance ) ) return false; // main message loop: MSG msg; ZeroMemory( &msg, sizeof( msg ) ); while( msg.message!=WM_QUIT ) { // Check the message queue while (GetMessage(&msg, wndHandle, 0, 0) ) { TranslateMessage( &msg ); DispatchMessage( &msg ); } } return (int) msg.wParam; } This is the error ! ! ! d:\c++\example1\example1\winmain.cpp(16) : error C2731: 'WinMain' : function cannot be overloaded d:\c++\example1\example1\winmain.cpp(14) : see declaration of 'WinMain' Thanks for the Help ! ! !

Share this post


Link to post
Share on other sites
Advertisement
Well, the error means like you have 2 or more winmains, or you have a different prototype than implentation..

Share this post


Link to post
Share on other sites
no the error means ur winmain has more or less paramters than it is supposed to which is wierd bc ur WinMain has the right params as far as i can see.
-Cory

Share this post


Link to post
Share on other sites
From WinMain:

int WinMain(
HINSTANCE hInstance,
HINSTANCE hPrevInstance,
LPSTR lpCmdLine,
int nCmdShow
);


Look at the way you have defined it: int WINAPI WinMain( HINSTANCE hInstance, HINSTANCE hPrevInstance, LPTSTR lpCmdLine, int nCmdShow ).

You need to use LPSTR instead of LPTSTR. To use LPTSTR, you should use the function GetCommandLine()


jfl.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!