#include <windows.h>
class EGWin {
public:
EGWin(void);
virtual ~EGWin(void);
int PASCAL WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow);
};
int PASCAL EGWin::WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow)
{
return 0;
}
Even with it this simple I get a link error because it can't find _WinMain@16 referenced in function _WinMainCRTStartup
Any ideas to get this going would be great. Thanks.
Windows class
I'm trying to make a class that makes a window. So far I have:
You have to specify the WinMain function outside of a class. You could do for example:
Another possibility would to make the WinMain function static and call it like
You also might want to have a look at this article.
int WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow){ EGWin MyWinClass; return MyWinClass.WinMain( hInstance, hPrevInstance, lpCmdLine, nCmdShow );}
Another possibility would to make the WinMain function static and call it like
return EGWin::WinMain( hInstance, hPrevInstance, lpCmdLine, nCmdShow );
You also might want to have a look at this article.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement