Sign in to follow this  
alfa2

Help Please ! !

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
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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this