X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/3295e23873ab52d5be80c52b8647909546936ae2..300b5dfabc6f7f0d9fc3f7865374b43e79c8f465:/src/msw/helpchm.cpp diff --git a/src/msw/helpchm.cpp b/src/msw/helpchm.cpp index 88dff23aab..ab91913ff2 100644 --- a/src/msw/helpchm.cpp +++ b/src/msw/helpchm.cpp @@ -27,6 +27,11 @@ #include "wx/dynlib.h" +#ifndef WX_PRECOMP + #include "wx/intl.h" + #include "wx/app.h" +#endif + #include "wx/msw/private.h" // instead of including htmlhelp.h, duplicate the things from it we need here @@ -101,26 +106,25 @@ struct HH_AKLINK // dll symbol handle static HTMLHELP gs_htmlHelp = 0; -static wxPluginLibrary *gs_libHtmlHelp = NULL; static bool LoadHtmlHelpLibrary() { - gs_libHtmlHelp = wxPluginManager::LoadLibrary( _T("HHCTRL.OCX"), wxDL_DEFAULT | wxDL_VERBATIM ); + wxPluginLibrary *lib = wxPluginManager::LoadLibrary( _T("HHCTRL.OCX"), wxDL_DEFAULT | wxDL_VERBATIM ); - if( !gs_libHtmlHelp ) + if( !lib ) { wxLogError(_("MS HTML Help functions are unavailable because the MS HTML Help library is not installed on this machine. Please install it.")); return FALSE; } else { - gs_htmlHelp = (HTMLHELP)gs_libHtmlHelp->GetSymbol( HTMLHELP_NAME ); + gs_htmlHelp = (HTMLHELP)lib->GetSymbol( HTMLHELP_NAME ); if( !gs_htmlHelp ) { wxLogError(_("Failed to initialize MS HTML Help.")); - gs_libHtmlHelp->UnrefLib(); + lib->UnrefLib(); return FALSE ; } } @@ -130,10 +134,9 @@ static bool LoadHtmlHelpLibrary() static void UnloadHtmlHelpLibrary() { - if( gs_htmlHelp ) + if ( gs_htmlHelp ) { wxPluginManager::UnloadLibrary( _T("HHCTRL.OCX") ); - gs_libHtmlHelp->UnrefLib(); gs_htmlHelp = 0; }