Re: Converting a dialog based app to - - - What?
"Scott McPhillips [MVP]" <org-dot-mvps-at-scottmcp> wrote in message
news:eKdKo6kcHHA.1000@TK2MSFTNGP05.phx.gbl...
The Single Document without doc/view support might be a reasonable start
if you don't mind having a caption (you could easily get rid of the
toolbar and menu). Or, you can simply display a class you derive from
CWnd in your InitInstance.
That's what I do also:
BOOL CMyApp::InitInstance()
{
CMainWnd *pMainWnd = new CMainWnd;
if ( !pMainWnd->Init() )
return FALSE;
m_pMainWnd = pMainWnd;
return TRUE;
}
where:
class CMainWnd : public CFrameWnd
{
public:
CMainWnd(); // protected constructor used by dynamic creation
BOOL Init();
protected:
virtual ~CMainWnd();
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CMainWnd)
protected:
//}}AFX_VIRTUAL
// Generated message map functions
protected:
//{{AFX_MSG(CMainWnd)
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
BOOL CMainWnd::Init()
{
CRect rcWnd (0, 0, 1, 1); // can be anything because window is hidden
if (!CreateEx (0, AfxRegisterWndClass(0), NULL, WS_POPUP, rcWnd, NULL,
0))
return FALSE;
return TRUE;
}
Instead of creating a hidden window, you can specify a legitimate size and
the WS_VISIBLE style to make it visible. But keep the WS_POPUP to avoid the
caption bar. If you want it resizeable you mean need the WS_THICKFRAME or
something like that.
-- David