main.cpp
#include <afxwin.h> class CMyFrame : public CFrameWnd { public: CMyFrame(); }; CMyFrame::CMyFrame() { Create(NULL, "main", WS_VISIBLE, CRect(0, 0, 300, 300)); } class CMyApp : public CWinApp { public: BOOL InitInstance(); }; CMyApp myApp; BOOL CMyApp::InitInstance() { CMyFrame *pFrame = new CMyFrame; m_pMainWnd = pFrame; pFrame->ShowWindow(SW_SHOW); pFrame->UpdateWindow(); return TRUE; }
編譯、執行
$ export WINEPREFIX=/home/user/.wine_x86 $ box86 wine nmake -f main.mak
完成