程式語言 - Visual C++ 6.0 - Microsoft Fundation Class (MFC) - Single Document Interface (SDI) - Create Window



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_amd64

$ box86 wine nmake -f main.mak

完成