Home > Uncategorized > WTL::CRichEditCtrl

WTL::CRichEditCtrl

This was a time waster: I had a simple dialog-based application which happened to include a RichEdit control. But every time the program launched, the wizard created Run function printed “Main dialog creation failed!” and stopped. Everything would work fine until I added a RichEdit control.

Finally I found that adding the following to my _tWinMain resolved the issue:

HINSTANCE hInstRich = ::LoadLibrary(CRichEditCtrl::GetLibraryName());

Unfortunately I forgot that Rich Edit isn’t a common control and is not initialized with InitCommonControlsEx. As far as I know, this is the only control supported in the VS dialog editor that needs its own LoadLibrary.

Categories: Uncategorized Tags:
  1. No comments yet.
  1. No trackbacks yet.