+ // always try load riched20.dll first - like this we won't have to reload
+ // it later if we're first asked for RE 1 and then for RE 2 or 3
+ wxString dllname = _T("riched20.dll");
+ gs_hRichEdit = ::LoadLibrary(dllname);
+ if ( !gs_hRichEdit && (version == 1) )
+ {
+ // fall back to RE 1
+ dllname = _T("riched32.dll");
+ gs_hRichEdit = ::LoadLibrary(dllname);
+ }
+
+ if ( !gs_hRichEdit )
+ {
+ wxLogSysError(_("Could not load Rich Edit DLL '%s'"), dllname.c_str());
+
+ gs_verRichEdit = -1;
+
+ return FALSE;
+ }
+
+ gs_verRichEdit = version;
+
+ return TRUE;
+}
+
+#endif // wxUSE_RICHEDIT
+
+/* static */
+int wxApp::GetComCtl32Version()
+{
+ // TODO should use DllGetVersion() instead of this hack
+
+ // cache the result
+ static int s_verComCtl32 = -1; // MT-FIXME
+
+ if ( s_verComCtl32 == -1 )
+ {
+ s_verComCtl32 = 0;
+
+ // have we loaded COMCTL32 yet?
+ HMODULE theModule = ::GetModuleHandle(wxT("COMCTL32"));
+
+ // if so, then we can check for the version
+ if (theModule)