// normally this shouldn't be needed any longer, i.e. it works without
// it for me (VZ)
//
-// (2) You should link with MFC DLL, not static libraries
-
-// suppress warning about WINVER not being defined from MFC
-#ifndef WINVER
-#define WINVER 0x7000
-#endif
+// (2) You should link with MFC DLL, not static libraries: or, to use static
+// run-time libraries, use this command for both building wxWidgets and
+// the sample:
+//
+// nmake -f makefile.vc BUILD=debug SHARED=0 DEBUG_RUNTIME_LIBS=0 RUNTIME_LIBS=static all
+//
+// Unless the run-time library settings match for wxWidgets and MFC, you will get
+// link errors for symbols such as __mbctype, __argc, and __argv
#include "stdafx.h"
CMainWindow::CMainWindow()
{
- LoadAccelTable( "MainAccelTable" );
- Create( NULL, "Hello Foundation Application",
- WS_OVERLAPPEDWINDOW, rectDefault, NULL, "MainMenu" );
+ LoadAccelTable( _T("MainAccelTable") );
+ Create( NULL, _T("Hello Foundation Application"),
+ WS_OVERLAPPEDWINDOW, rectDefault, NULL, _T("MainMenu") );
}
void CMainWindow::OnPaint()
{
- CString s = "Hello, Windows!";
+ CString s = _T("Hello, Windows!");
CPaintDC dc( this );
CRect rect;
void CMainWindow::OnAbout()
{
- CDialog about( "AboutBox", this );
+ CDialog about( _T("AboutBox"), this );
about.DoModal();
}
void CMainWindow::OnTest()
{
- wxMessageBox("This is a wxWidgets message box.\nWe're about to create a new wxWidgets frame.", "wxWidgets", wxOK);
+ wxMessageBox(_T("This is a wxWidgets message box.\nWe're about to create a new wxWidgets frame."), _T("wxWidgets"), wxOK);
wxGetApp().CreateFrame();
}
wxSetInstance(m_hInstance);
wxApp::m_nCmdShow = m_nCmdShow;
int argc = 0;
- char **argv = NULL;
+ wxChar **argv = NULL;
wxEntryStart(argc, argv);
if ( !wxTheApp || !wxTheApp->CallOnInit() )
return FALSE;
wxFrame *MyApp::CreateFrame()
{
- MyChild *subframe = new MyChild(NULL, "Canvas Frame", wxPoint(10, 10), wxSize(300, 300),
+ MyChild *subframe = new MyChild(NULL, _T("Canvas Frame"), wxPoint(10, 10), wxSize(300, 300),
wxDEFAULT_FRAME_STYLE);
- subframe->SetTitle("wxWidgets canvas frame");
+ subframe->SetTitle(_T("wxWidgets canvas frame"));
// Give it a status line
subframe->CreateStatusBar();
// Make a menubar
wxMenu *file_menu = new wxMenu;
- file_menu->Append(HELLO_NEW, "&New MFC Window");
- file_menu->Append(HELLO_QUIT, "&Close");
+ file_menu->Append(HELLO_NEW, _T("&New MFC Window"));
+ file_menu->Append(HELLO_QUIT, _T("&Close"));
wxMenuBar *menu_bar = new wxMenuBar;
- menu_bar->Append(file_menu, "&File");
+ menu_bar->Append(file_menu, _T("&File"));
// Associate the menu bar with the frame
subframe->SetMenuBar(menu_bar);
dc.DrawEllipse(250, 250, 100, 50);
dc.DrawLine(50, 230, 200, 230);
- dc.DrawText("This is a test string", 50, 230);
+ dc.DrawText(_T("This is a test string"), 50, 230);
}
// This implements a tiny doodling program! Drag the mouse using