From 059d8c474cd5f0a3b578ef02565fb0cca5845de5 Mon Sep 17 00:00:00 2001 From: jeblanchard Date: Mon, 2 Jun 2008 04:29:54 +0000 Subject: [PATCH] std::string-ify drivers/win/help.* --- src/drivers/win/help.cpp | 19 ++++++++----------- src/drivers/win/help.h | 3 ++- 2 files changed, 10 insertions(+), 12 deletions(-) diff --git a/src/drivers/win/help.cpp b/src/drivers/win/help.cpp index 3621d16b..3ff79447 100644 --- a/src/drivers/win/help.cpp +++ b/src/drivers/win/help.cpp @@ -2,16 +2,13 @@ #include "help.h" #include -void OpenHelpWindow(const char *subpage) +using std::string; + +void OpenHelpWindow(string subpage) { - char helpFileName[MAX_PATH]; - strcpy(helpFileName, BaseDirectory); - strcat(helpFileName, "\\fceux.chm"); - if (subpage) - { - strcat(helpFileName, "::/"); - strcat(helpFileName, subpage); - strcat(helpFileName, ".htm"); - } - HtmlHelp(GetDesktopWindow(), helpFileName, HH_DISPLAY_TOPIC, (DWORD)NULL); + string helpFileName = BaseDirectory; + helpFileName += "\\fceux.chm"; + if (subpage.length()) + helpFileName = helpFileName + "::/" + subpage + ".htm"; + HtmlHelp(GetDesktopWindow(), helpFileName.c_str(), HH_DISPLAY_TOPIC, (DWORD)NULL); } diff --git a/src/drivers/win/help.h b/src/drivers/win/help.h index 1c6947ef..153c7f9f 100644 --- a/src/drivers/win/help.h +++ b/src/drivers/win/help.h @@ -1,2 +1,3 @@ +#include // Open a help window to the default topic, or to ::/subpage.htm -void OpenHelpWindow(const char *subpage = NULL); +void OpenHelpWindow(std::string subpage = "");