Is the documentation for Rich Edit Controls really bad (wrong?) As it seems? Right now, I manually call LoadLibrary ("riched20.dll") to display Rich Edit Control. The documentation for Rich Edit poorly demonstrates this in the first code example for using Rich Edit controls.
He talks about calling InitCommonControlsEx () to add visual styles, but doesn't mention which flags will pass.
Is there a better way to load a Rich Edit control?
http://msdn.microsoft.com/en-us/library/bb787877(VS.85).aspx
Here is the only code I could write to make it work:
#include "Richedit.h"
#include "commctrl.h"
INITCOMMONCONTROLSEX icex;
icex.dwSize = sizeof(INITCOMMONCONTROLSEX);
icex.dwICC = ICC_USEREX_CLASSES;
InitCommonControlsEx(&icex);
LoadLibrary("riched20.dll");
hWndRichEdit = CreateWindowEx(
ES_SUNKEN,
RICHEDIT_CLASS,
"",
WS_BORDER | WS_VISIBLE | WS_CHILD,
2, 2, 100, 24,
hWnd, (HMENU) ID_RICH_EDIT, hInst, NULL);
source
share