This class adds a simple tab control in a WTL based MDI application. It is partly based on the freeware MFC version from Dundas Software available at
First include the header file and create a
CMDITabImpl member in the main frame class.
#include <span class="code-string">"atlmditab.h"
class CMainFrame : public ....
Then attach to the control in main frame's
LRESULT OnCreate(UINT , WPARAM ,
LPARAM , BOOL& )
Then you must add an
UpdateLayout() function in main frame to place the tab control correctly. If anybody finds a solution for WTL that won't require this extra code, please let me know.
void UpdateLayout(BOOL bResizeBars = TRUE)
// position bars and offset their dimensions
This class is written for learning WTL, so there are surely lots of bugs in the implementation. And some features are not implemented yet, like icon support and context menu. I will work on them later when I get more time. Cheers.