Article ID: 191355
Article Last Modified on 12/10/2003
LRESULT OnCreate(UINT uMsg, WPARAM wParam, LPARAM lParam,
BOOL& bHandled)
{
RECT rc;
GetWindowRect(&rc);
rc.right -= rc.left;
rc.bottom -= rc.top;
rc.top = rc.left = 0;
::InitCommonControls(); // ADD THIS LINE
m_ctlSysListView32.Create(m_hWnd, rc);
return 0;
}
For the richedit control, you'll need to load Riched32.dll and unload it:
BEGIN_MSG_MAP(CRichEdit6)
MESSAGE_HANDLER(WM_DESTROY, OnDestroy) // Add this line.
// ...
END_MSG_MAP()
HINSTANCE m_hLibRichEdit; // Add this line.
LRESULT OnCreate(UINT uMsg, WPARAM wParam, LPARAM lParam,
BOOL& bHandled)
{
RECT rc;
GetWindowRect(&rc);
rc.right -= rc.left;
rc.bottom -= rc.top;
rc.top = rc.left = 0;
m_hLibRichEdit =
LoadLibrary(_T("RICHED32.DLL")); // Add this line.
m_ctlRichEdit.Create(m_hWnd, rc);
return 0;
}
// Add this function.
LRESULT OnDestroy(UINT, WPARAM, LPARAM, BOOL&)
{
m_ctlRichEdit.DestroyWindow();
FreeLibrary(m_hLibRichEdit);
return 0;
}
Additional query words: ocx RichEdit SysListView32 SysTreeView32 SysAnimate32 SysTabControl32 rich edit listview treeview animate tab tabcontrol tooltip header hotkey image list progress slider spin buttton
Keywords: kbbug kbfix kbvc600fix kbatl300fix kbctrlcreate kbwizard KB191355