Skip to main content.

Archives

This is the archive for March 2005

WiX Tutorial

The Windows Installer XML (WiX) is a toolset that builds Windows installation packages from XML source code. The toolset provides a command line environment that developers may integrate into their build processes to build MSI and MSM setup packages.

WiX Tutorial

CMainFrame and CLayoutMgrBase<>

When your mainframe class inherit from both CFrameWindowImpl<> and CLayoutMgrBase<>, you need to handle the resize of the window a little bit differently than when using a standard CWindowImpl<> class. You need to override the default CFrameWindowImpl<>::UpdateLayout() and CLayoutMgrBase<>::GetRect().


class CMainFrame :
...,
public CFrameWindowImpl<CMainFrame>,
public CLayoutMgrBase<CMainFrame>
{
...

void UpdateLayout(BOOL bResizeBars = TRUE)
{
RECT rect = { 0 };
GetClientRect(&rect);

// position bars and offset their dimensions
UpdateBarsPosition(rect, bResizeBars);

// resize client window
CLayoutMgrBase<CMainFrame>::UpdateLayout();
}

CRect GetRect()
{
RECT rect = { 0 };
GetClientRect(&rect);

// position bars and offset their dimensions
UpdateBarsPosition(rect, FALSE);
return rect;
}

};