From f8b6d19a94564d491ecbac932ab60aa8801d395e Mon Sep 17 00:00:00 2001 From: mjbudd77 Date: Sun, 15 Aug 2021 21:09:12 -0400 Subject: [PATCH] Build fixes for Qt windows chm help file loader. --- src/CMakeLists.txt | 2 +- src/drivers/Qt/HelpPages.cpp | 15 ++++++++++++--- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index c4164c85..88a30063 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -34,7 +34,7 @@ if(WIN32) include_directories( ${CMAKE_CURRENT_SOURCE_DIR}/drivers/win/zlib ) set( OPENGL_LDFLAGS OpenGL::GL ) set( SDL2_LDFLAGS ${SDL_INSTALL_PREFIX}/SDL2/lib/x64/SDL2.lib ) - set( SYS_LIBS wsock32 ws2_32 vfw32 ) + set( SYS_LIBS wsock32 ws2_32 vfw32 Htmlhelp ) set(APP_ICON_RESOURCES_WINDOWS ${CMAKE_SOURCE_DIR}/icons/fceux.rc ) else(WIN32) # Non Windows System diff --git a/src/drivers/Qt/HelpPages.cpp b/src/drivers/Qt/HelpPages.cpp index 1bdd7999..5b85ff73 100644 --- a/src/drivers/Qt/HelpPages.cpp +++ b/src/drivers/Qt/HelpPages.cpp @@ -2,20 +2,29 @@ #include +#include "driver.h" #include "Qt/HelpPages.h" +#include "Qt/ConsoleWindow.h" #ifdef WIN32 +#include #include void OpenHelpWindow(std::string subpage) { - std::string helpFileName = BaseDirectory; - helpFileName += "\\fceux.chm"; + HWND helpWin; + std::string helpFileName = FCEUI_GetBaseDirectory(); + helpFileName += "\\..\\doc\\fceux.chm"; if (subpage.length() > 0) { helpFileName = helpFileName + "::/" + subpage + ".htm"; } - HtmlHelp(GetDesktopWindow(), helpFileName.c_str(), HH_DISPLAY_TOPIC, (DWORD)NULL); + //printf("Looking for HelpFile '%s'\n", helpFileName.c_str() ); + helpWin = HtmlHelp( HWND(consoleWindow->winId()), helpFileName.c_str(), HH_DISPLAY_TOPIC, (DWORD)NULL); + if ( helpWin == NULL ) + { + printf("Error: Failed to open help file '%s'\n", helpFileName.c_str() ); + } } #else