// first: mfc[version][u]d.lib
// - [version] -> 42 or 70 or 80 etc
// - u if using Unicode
-//
-// (4) Unicode builds may produce the linker error "unresolved external symbol _WinMain@16".
-// MFC requires you to manually add the Unicode entry point to the linker settings,
-// Entry point symbol -> wWinMainCRTStartup
#include "stdafx.h"
// notice use of IMPLEMENT_APP_NO_MAIN() instead of the usual IMPLEMENT_APP!
IMPLEMENT_APP_NO_MAIN(MyApp)
+#ifdef _UNICODE
+// In Unicode build MFC normally requires to manually change the entry point to
+// wWinMainCRTStartup() but to avoid having to modify the project options to do
+// it we provide an adapter for it.
+extern "C" int wWinMainCRTStartup();
+
+int WINAPI WinMain(HINSTANCE, HINSTANCE, char *, int)
+{
+ wWinMainCRTStartup();
+}
+#endif // _UNICODE
+
CMainWindow::CMainWindow()
{
LoadAccelTable( wxT("MainAccelTable") );