diff --git a/source/Applewin.cpp b/source/Applewin.cpp index 7562b5ad..0937b330 100644 --- a/source/Applewin.cpp +++ b/source/Applewin.cpp @@ -66,7 +66,7 @@ static UINT16 g_AppleWinVersion[4] = {0}; static UINT16 g_OldAppleWinVersion[4] = {0}; TCHAR VERSIONSTRING[VERSIONSTRING_SIZE] = "xx.yy.zz.ww"; -const TCHAR *g_pAppTitle = NULL; +std::string g_pAppTitle; eApple2Type g_Apple2Type = A2TYPE_APPLE2EENHANCED; @@ -88,7 +88,7 @@ static bool g_bHookSystemKey = true; static bool g_bHookAltTab = false; static bool g_bHookAltGrControl = false; -TCHAR g_sCurrentDir[MAX_PATH] = TEXT(""); // Also Starting Dir. Debugger uses this when load/save +std::string g_sCurrentDir; // Also Starting Dir. Debugger uses this when load/save bool g_bRestart = false; bool g_bRestartFullScreen = false; @@ -748,18 +748,18 @@ void LoadConfiguration(void) //=========================================================================== -bool SetCurrentImageDir(const char* pszImageDir) +bool SetCurrentImageDir(const std::string & pszImageDir) { - strcpy(g_sCurrentDir, pszImageDir); + g_sCurrentDir = pszImageDir; - int nLen = strlen( g_sCurrentDir ); + int nLen = g_sCurrentDir.size(); if ((nLen > 0) && (g_sCurrentDir[ nLen - 1 ] != '\\')) { g_sCurrentDir[ nLen + 0 ] = '\\'; - g_sCurrentDir[ nLen + 1 ] = 0; + g_sCurrentDir.resize(nLen + 1); } - if( SetCurrentDirectory(g_sCurrentDir) ) + if( SetCurrentDirectory(g_sCurrentDir.c_str()) ) return true; return false; diff --git a/source/Applewin.h b/source/Applewin.h index 4d2dcc7a..565ae0ab 100644 --- a/source/Applewin.h +++ b/source/Applewin.h @@ -6,12 +6,12 @@ void LogFileTimeUntilFirstKeyReadReset(void); void LogFileTimeUntilFirstKeyRead(void); -bool SetCurrentImageDir(const char* pszImageDir); +bool SetCurrentImageDir(const std::string & pszImageDir); extern const UINT16* GetOldAppleWinVersion(void); extern TCHAR VERSIONSTRING[]; // Constructed in WinMain() -extern const TCHAR *g_pAppTitle; +extern std::string g_pAppTitle; extern eApple2Type g_Apple2Type; eApple2Type GetApple2Type(void); @@ -35,7 +35,7 @@ void SetLoadedSaveStateFlag(const bool bFlag); bool GetHookAltGrControl(void); extern std::string g_sProgramDir; -extern TCHAR g_sCurrentDir[MAX_PATH]; +extern std::string g_sCurrentDir; extern bool g_bRestart; extern bool g_bRestartFullScreen; diff --git a/source/Configuration/PropertySheetHelper.cpp b/source/Configuration/PropertySheetHelper.cpp index 4fe3b2bb..5c6979f1 100644 --- a/source/Configuration/PropertySheetHelper.cpp +++ b/source/Configuration/PropertySheetHelper.cpp @@ -338,7 +338,7 @@ void CPropertySheetHelper::PostMsgAfterClose(HWND hWnd, PAGETYPE page) if (m_ConfigNew.m_Apple2Type == A2TYPE_CLONE) { - MessageBox(hWnd, "Error - Unable to change configuration\n\nReason: A specific clone wasn't selected from the Advanced tab", g_pAppTitle, MB_ICONSTOP | MB_SETFOREGROUND); + MessageBox(hWnd, "Error - Unable to change configuration\n\nReason: A specific clone wasn't selected from the Advanced tab", g_pAppTitle.c_str(), MB_ICONSTOP | MB_SETFOREGROUND); return; } diff --git a/source/Debugger/Debug.cpp b/source/Debugger/Debug.cpp index 1ad20c0e..6ef443a9 100644 --- a/source/Debugger/Debug.cpp +++ b/source/Debugger/Debug.cpp @@ -337,7 +337,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA static void _ConfigColorsReset ( BYTE *pPalDst = 0 ); // Config - Save - bool ConfigSave_BufferToDisk ( char *pFileName, ConfigSave_t eConfigSave ); + bool ConfigSave_BufferToDisk ( const char *pFileName, ConfigSave_t eConfigSave ); void ConfigSave_PrepareHeader ( const Parameters_e eCategory, const Commands_e eCommandClear ); // Drawing @@ -2024,31 +2024,29 @@ Update_t CmdTraceFile (int nArgs) } else { - char sFileName[MAX_PATH]; + std::string sFileName;; if (nArgs) - strcpy( sFileName, g_aArgs[1].sArg ); + sFileName = g_aArgs[1].sArg; else - strcpy( sFileName, g_sFileNameTrace ); + sFileName = g_sFileNameTrace; g_bTraceFileWithVideoScanner = (nArgs >= 2); - char sFilePath[ MAX_PATH ]; - strcpy(sFilePath, g_sCurrentDir); // TODO: g_sDebugDir - strcat(sFilePath, sFileName ); + const std::string sFilePath = g_sCurrentDir + sFileName; - g_hTraceFile = fopen( sFilePath, "wt" ); + g_hTraceFile = fopen( sFilePath.c_str(), "wt" ); if (g_hTraceFile) { const char* pTextHdr = g_bTraceFileWithVideoScanner ? "Trace (with video info) started: %s" : "Trace started: %s"; - ConsoleBufferPushFormat( sText, pTextHdr, sFilePath ); + ConsoleBufferPushFormat( sText, pTextHdr, sFilePath.c_str() ); g_bTraceHeader = true; } else { - ConsoleBufferPushFormat( sText, "Trace ERROR: %s", sFilePath ); + ConsoleBufferPushFormat( sText, "Trace ERROR: %s", sFilePath.c_str() ); } } @@ -2324,7 +2322,7 @@ Update_t CmdConfigLoad (int nArgs) //=========================================================================== -bool ConfigSave_BufferToDisk ( char *pFileName, ConfigSave_t eConfigSave ) +bool ConfigSave_BufferToDisk ( const char *pFileName, ConfigSave_t eConfigSave ) { bool bStatus = false; @@ -2337,10 +2335,7 @@ bool ConfigSave_BufferToDisk ( char *pFileName, ConfigSave_t eConfigSave ) if (eConfigSave == CONFIG_SAVE_FILE_APPEND) pMode = sModeAppend; - char sFileName[ MAX_PATH ]; - - _tcscpy(sFileName, g_sCurrentDir); // TODO: g_sDebugDir - _tcscat(sFileName, pFileName ); + const std::string sFileName = g_sCurrentDir + pFileName; // TODO: g_sDebugDir FILE *hFile = fopen( pFileName, pMode ); @@ -4106,7 +4101,7 @@ Update_t CmdMemoryFill (int nArgs) } -static TCHAR g_sMemoryLoadSaveFileName[ MAX_PATH ] = TEXT(""); +static std::string g_sMemoryLoadSaveFileName; // "PWD" @@ -4118,7 +4113,7 @@ Update_t CmdConfigGetDebugDir (int nArgs) TCHAR sPath[ MAX_PATH + 8 ]; // TODO: debugger dir has no ` CONSOLE_COLOR_ESCAPE_CHAR ?!?! - ConsoleBufferPushFormat( sPath, "Path: %s", g_sCurrentDir ); + ConsoleBufferPushFormat( sPath, "Path: %s", g_sCurrentDir.c_str() ); return ConsoleUpdate(); } @@ -4140,30 +4135,27 @@ Update_t CmdConfigSetDebugDir (int nArgs) if (strncmp("\\\\?\\", g_aArgs[1].sArg, 4) == 0) return Help_Arg_1( CMD_CONFIG_SET_DEBUG_DIR ); - TCHAR sPath[ MAX_PATH + 1 ]; + std::string sPath; if (g_aArgs[1].sArg[1] == ':') // Absolute { - _tcscpy( sPath, g_aArgs[1].sArg ); + sPath = g_aArgs[1].sArg; } else if (g_aArgs[1].sArg[0] == '\\') // Absolute { if (g_sCurrentDir[1] == ':') { - _tcsncpy( sPath, g_sCurrentDir, 2 ); // Prefix with drive letter & colon - sPath[2] = 0; - _tcscat( sPath, g_aArgs[1].sArg ); + sPath = g_sCurrentDir.substr(0, 2) + g_aArgs[1].sArg; // Prefix with drive letter & colon } else { - _tcscpy( sPath, g_aArgs[1].sArg ); + sPath = g_aArgs[1].sArg; } } else // Relative { // TODO: Support ".." - currently just appends (which still works) - _tcscpy( sPath, g_sCurrentDir ); // TODO: debugger dir has no ` CONSOLE_COLOR_ESCAPE_CHAR ?!?! - _tcscat( sPath, g_aArgs[1].sArg ); + sPath = g_sCurrentDir + g_aArgs[1].sArg; // TODO: debugger dir has no ` CONSOLE_COLOR_ESCAPE_CHAR ?!?! } if ( SetCurrentImageDir( sPath ) ) @@ -4405,9 +4397,6 @@ Update_t CmdMemoryLoad (int nArgs) if (g_aArgs[ iArgComma1 ].eToken != TOKEN_COMMA) return Help_Arg_1( CMD_MEMORY_LOAD ); - TCHAR sLoadSaveFilePath[ MAX_PATH ]; - _tcscpy( sLoadSaveFilePath, g_sCurrentDir ); // TODO: g_sDebugDir - WORD nAddressStart = 0; WORD nAddress2 = 0; WORD nAddressEnd = 0; @@ -4441,9 +4430,9 @@ Update_t CmdMemoryLoad (int nArgs) if (bHaveFileName) { - _tcscpy( g_sMemoryLoadSaveFileName, pFileName ); + g_sMemoryLoadSaveFileName = pFileName; } - _tcscat( sLoadSaveFilePath, g_sMemoryLoadSaveFileName ); + const std::string sLoadSaveFilePath = g_sCurrentDir + g_sMemoryLoadSaveFileName; // TODO: g_sDebugDir BYTE * const pMemBankBase = bBankSpecified ? MemGetBankPtr(nBank) : mem; if (!pMemBankBase) @@ -4452,7 +4441,7 @@ Update_t CmdMemoryLoad (int nArgs) return ConsoleUpdate(); } - FILE *hFile = fopen( sLoadSaveFilePath, "rb" ); + FILE *hFile = fopen( sLoadSaveFilePath.c_str(), "rb" ); if (hFile) { int nFileBytes = _GetFileSize( hFile ); @@ -4497,7 +4486,7 @@ Update_t CmdMemoryLoad (int nArgs) CmdConfigGetDebugDir( 0 ); TCHAR sFile[ MAX_PATH + 8 ]; - ConsoleBufferPushFormat( sFile, "File: ", g_sMemoryLoadSaveFileName ); + ConsoleBufferPushFormat( sFile, "File: ", g_sMemoryLoadSaveFileName.c_str() ); } return ConsoleUpdate(); @@ -4779,14 +4768,16 @@ Update_t CmdMemorySave (int nArgs) { if (! bHaveFileName) { + TCHAR temp[MAX_PATH]; if (! bBankSpecified) - sprintf( g_sMemoryLoadSaveFileName, "%04X.%04X.bin", nAddressStart, nAddressLen ); + sprintf( temp, "%04X.%04X.bin", nAddressStart, nAddressLen ); else - sprintf( g_sMemoryLoadSaveFileName, "%04X.%04X.bank%02X.bin", nAddressStart, nAddressLen, nBank ); + sprintf( temp, "%04X.%04X.bank%02X.bin", nAddressStart, nAddressLen, nBank ); + g_sMemoryLoadSaveFileName = temp; } else { - _tcscpy( g_sMemoryLoadSaveFileName, g_aArgs[ 1 ].sArg ); + g_sMemoryLoadSaveFileName = g_aArgs[ 1 ].sArg; } sLoadSaveFilePath += g_sMemoryLoadSaveFileName; @@ -5055,9 +5046,8 @@ Update_t CmdNTSC (int nArgs) if( nLen == 0 ) pFileName = "AppleWinNTSC4096x4@32.data"; - static TCHAR sPaletteFilePath[ MAX_PATH ]; - _tcscpy( sPaletteFilePath, g_sCurrentDir ); - _tcscat( sPaletteFilePath, pFileName ); + static std::string sPaletteFilePath; + sPaletteFilePath = g_sCurrentDir + pFileName; class ConsoleFilename { @@ -5067,7 +5057,7 @@ Update_t CmdNTSC (int nArgs) TCHAR text[ CONSOLE_WIDTH*2 ] = TEXT(""); size_t len1 = strlen( pPrefixText ); - size_t len2 = strlen( sPaletteFilePath ); + size_t len2 = sPaletteFilePath.size(); size_t len = len1 + len2; if (len >= CONSOLE_WIDTH) @@ -5083,12 +5073,12 @@ Update_t CmdNTSC (int nArgs) #endif // File path is too long // TODO: Need to split very long path names - strncpy( text, sPaletteFilePath, CONSOLE_WIDTH ); + strncpy( text, sPaletteFilePath.c_str(), CONSOLE_WIDTH ); ConsoleBufferPush( text ); // TODO: Switch ConsoleBufferPush() to ConsoleBufferPushFormat() } else { - ConsoleBufferPushFormat( text, "%s: %s", pPrefixText, sPaletteFilePath ); + ConsoleBufferPushFormat( text, "%s: %s", pPrefixText, sPaletteFilePath.c_str() ); } } }; @@ -5450,7 +5440,7 @@ Update_t CmdNTSC (int nArgs) else if (iParam == PARAM_SAVE) { - FILE *pFile = fopen( sPaletteFilePath, "w+b" ); + FILE *pFile = fopen( sPaletteFilePath.c_str(), "w+b" ); if( pFile ) { size_t nWrote = 0; @@ -5493,7 +5483,7 @@ Update_t CmdNTSC (int nArgs) else if (iParam == PARAM_LOAD) { - FILE *pFile = fopen( sPaletteFilePath, "rb" ); + FILE *pFile = fopen( sPaletteFilePath.c_str(), "rb" ); if( pFile ) { strcpy( aStatusText, "Loaded" ); @@ -5631,13 +5621,13 @@ int CmdTextSave (int nArgs) std::string sLoadSaveFilePath = g_sCurrentDir; // g_sProgramDir if( bHaveFileName ) - _tcscpy( g_sMemoryLoadSaveFileName, g_aArgs[ 1 ].sArg ); + g_sMemoryLoadSaveFileName = g_aArgs[ 1 ].sArg; else { if( VideoGetSW80COL() ) - sprintf( g_sMemoryLoadSaveFileName, "AppleWin_Text80.txt" ); + g_sMemoryLoadSaveFileName = "AppleWin_Text80.txt"; else - sprintf( g_sMemoryLoadSaveFileName, "AppleWin_Text40.txt" ); + g_sMemoryLoadSaveFileName = "AppleWin_Text40.txt"; } sLoadSaveFilePath += g_sMemoryLoadSaveFileName; @@ -5656,7 +5646,7 @@ int CmdTextSave (int nArgs) if (nWrote == 1) { TCHAR text[ CONSOLE_WIDTH ] = TEXT(""); - ConsoleBufferPushFormat( text, "Saved: %s", g_sMemoryLoadSaveFileName ); + ConsoleBufferPushFormat( text, "Saved: %s", g_sMemoryLoadSaveFileName.c_str() ); } else { @@ -6460,27 +6450,25 @@ Update_t CmdOutputRun (int nArgs) // IF @ON .... MemoryTextFile_t script; - TCHAR * pFileName = g_aArgs[ 1 ].sArg; + const std::string pFileName = g_aArgs[ 1 ].sArg; - TCHAR sFileName[ MAX_PATH ]; - TCHAR sMiniFileName[ CONSOLE_WIDTH ]; + std::string sFileName; + std::string sMiniFileName; // [CONSOLE_WIDTH]; // if (g_aArgs[1].bType & TYPE_QUOTED_2) - _tcsncpy( sMiniFileName, pFileName, sizeof(sMiniFileName) ); - sMiniFileName[sizeof(sMiniFileName)-1] = 0; + sMiniFileName = pFileName.substr(0, min(pFileName.size(), CONSOLE_WIDTH)); // _tcscat( sMiniFileName, ".aws" ); // HACK: MAGIC STRING if (pFileName[0] == '\\' || pFileName[1] == ':') // NB. Any prefix quote has already been stripped { // Abs pathname - _tcscpy(sFileName, sMiniFileName); + sFileName = sMiniFileName; } else { // Rel pathname - _tcscpy(sFileName, g_sCurrentDir); - _tcscat(sFileName, sMiniFileName); + sFileName = g_sCurrentDir + sMiniFileName; } if (script.Read( sFileName )) @@ -6503,7 +6491,7 @@ Update_t CmdOutputRun (int nArgs) ConsolePrintFormat( sText, "%sCouldn't load filename: %s%s" , CHC_ERROR , CHC_STRING - , sFileName + , sFileName.c_str() ); } diff --git a/source/Disk.cpp b/source/Disk.cpp index a29869d7..e5ef21d3 100644 --- a/source/Disk.cpp +++ b/source/Disk.cpp @@ -777,7 +777,7 @@ void Disk2InterfaceCard::NotifyInvalidImage(const int drive, LPCTSTR pszImageFil MessageBox( g_hFrameWindow, szBuffer, - g_pAppTitle, + g_pAppTitle.c_str(), MB_ICONEXCLAMATION | MB_SETFOREGROUND); } diff --git a/source/DiskImageHelper.cpp b/source/DiskImageHelper.cpp index c06a28f9..5180277f 100644 --- a/source/DiskImageHelper.cpp +++ b/source/DiskImageHelper.cpp @@ -120,7 +120,7 @@ bool CImageBase::WriteTrack(ImageInfo* pImageInfo, const int nTrack, LPBYTE pTra if (hZipFile == NULL) return false; - int nRes = zipOpenNewFileInZip(hZipFile, pImageInfo->szFilenameInZip, &pImageInfo->zipFileInfo, NULL, 0, NULL, 0, NULL, Z_DEFLATED, Z_BEST_SPEED); + int nRes = zipOpenNewFileInZip(hZipFile, pImageInfo->szFilenameInZip.c_str(), &pImageInfo->zipFileInfo, NULL, 0, NULL, 0, NULL, Z_DEFLATED, Z_BEST_SPEED); if (nRes != ZIP_OK) return false; @@ -241,7 +241,7 @@ bool CImageBase::WriteBlock(ImageInfo* pImageInfo, const int nBlock, LPBYTE pBlo if (hZipFile == NULL) return false; - int nRes = zipOpenNewFileInZip(hZipFile, pImageInfo->szFilenameInZip, &pImageInfo->zipFileInfo, NULL, 0, NULL, 0, NULL, Z_DEFLATED, Z_BEST_SPEED); + int nRes = zipOpenNewFileInZip(hZipFile, pImageInfo->szFilenameInZip.c_str(), &pImageInfo->zipFileInfo, NULL, 0, NULL, 0, NULL, Z_DEFLATED, Z_BEST_SPEED); if (nRes != ZIP_OK) return false; @@ -1469,8 +1469,7 @@ ImageError_e CImageHelperBase::CheckZipFile(LPCTSTR pszImageFilename, ImageInfo* if (nRes != UNZ_OK) return eIMAGE_ERROR_ZIP; - strncpy(pImageInfo->szFilenameInZip, szFilename, MAX_PATH); - pImageInfo->szFilenameInZip[MAX_PATH-1] = 0; + pImageInfo->szFilenameInZip = szFilename; memcpy(&pImageInfo->zipFileInfo.tmz_date, &file_info.tmu_date, sizeof(file_info.tmu_date)); pImageInfo->zipFileInfo.dosDate = file_info.dosDate; pImageInfo->zipFileInfo.internal_fa = file_info.internal_fa; diff --git a/source/DiskImageHelper.h b/source/DiskImageHelper.h index e30fd18d..d33ef57c 100644 --- a/source/DiskImageHelper.h +++ b/source/DiskImageHelper.h @@ -28,7 +28,7 @@ struct ImageInfo DWORD uOffset; bool bWriteProtected; UINT uImageSize; - char szFilenameInZip[MAX_PATH]; + std::string szFilenameInZip; zip_fileinfo zipFileInfo; UINT uNumEntriesInZip; // Floppy only diff --git a/source/Frame.cpp b/source/Frame.cpp index 9e0ef51b..b86d62dd 100644 --- a/source/Frame.cpp +++ b/source/Frame.cpp @@ -249,48 +249,48 @@ UINT Get3DBorderHeight(void) static void GetAppleWindowTitle() { - static TCHAR g_pAppleWindowTitle[ 128 ] = ""; + static std::string g_pAppleWindowTitle; g_pAppTitle = g_pAppleWindowTitle; switch (g_Apple2Type) { default: - case A2TYPE_APPLE2: _tcscpy(g_pAppleWindowTitle, TITLE_APPLE_2 ); break; - case A2TYPE_APPLE2PLUS: _tcscpy(g_pAppleWindowTitle, TITLE_APPLE_2_PLUS ); break; - case A2TYPE_APPLE2E: _tcscpy(g_pAppleWindowTitle, TITLE_APPLE_2E ); break; - case A2TYPE_APPLE2EENHANCED:_tcscpy(g_pAppleWindowTitle, TITLE_APPLE_2E_ENHANCED); break; - case A2TYPE_PRAVETS82: _tcscpy(g_pAppleWindowTitle, TITLE_PRAVETS_82 ); break; - case A2TYPE_PRAVETS8M: _tcscpy(g_pAppleWindowTitle, TITLE_PRAVETS_8M ); break; - case A2TYPE_PRAVETS8A: _tcscpy(g_pAppleWindowTitle, TITLE_PRAVETS_8A ); break; - case A2TYPE_TK30002E: _tcscpy(g_pAppleWindowTitle, TITLE_TK3000_2E ); break; + case A2TYPE_APPLE2: g_pAppleWindowTitle = TITLE_APPLE_2 ; break; + case A2TYPE_APPLE2PLUS: g_pAppleWindowTitle = TITLE_APPLE_2_PLUS ; break; + case A2TYPE_APPLE2E: g_pAppleWindowTitle = TITLE_APPLE_2E ; break; + case A2TYPE_APPLE2EENHANCED: g_pAppleWindowTitle = TITLE_APPLE_2E_ENHANCED; break; + case A2TYPE_PRAVETS82: g_pAppleWindowTitle = TITLE_PRAVETS_82 ; break; + case A2TYPE_PRAVETS8M: g_pAppleWindowTitle = TITLE_PRAVETS_8M ; break; + case A2TYPE_PRAVETS8A: g_pAppleWindowTitle = TITLE_PRAVETS_8A ; break; + case A2TYPE_TK30002E: g_pAppleWindowTitle = TITLE_TK3000_2E ; break; } #if _DEBUG - _tcscat( g_pAppleWindowTitle, " *DEBUG* " ); + g_pAppleWindowTitle += " *DEBUG* "; #endif if (g_nAppMode == MODE_LOGO) return; // TODO: g_bDisplayVideoModeInTitle - _tcscat( g_pAppleWindowTitle, " - " ); + g_pAppleWindowTitle += " - "; if( IsVideoStyle(VS_HALF_SCANLINES) ) { - _tcscat( g_pAppleWindowTitle," 50% " ); + g_pAppleWindowTitle += " 50% "; } - _tcscat( g_pAppleWindowTitle, g_apVideoModeDesc[ g_eVideoType ] ); + g_pAppleWindowTitle += g_apVideoModeDesc[ g_eVideoType ]; if (g_hCustomRomF8 != INVALID_HANDLE_VALUE) - _tcscat(g_pAppleWindowTitle,TEXT(" (custom rom)")); + g_pAppleWindowTitle += TEXT(" (custom rom)"); else if (sg_PropertySheet.GetTheFreezesF8Rom() && IS_APPLE2) - _tcscat(g_pAppleWindowTitle,TEXT(" (The Freeze's non-autostart F8 rom)")); + g_pAppleWindowTitle += TEXT(" (The Freeze's non-autostart F8 rom)"); switch (g_nAppMode) { - case MODE_PAUSED : _tcscat(g_pAppleWindowTitle,TEXT(" [")); _tcscat(g_pAppleWindowTitle,TITLE_PAUSED ); _tcscat(g_pAppleWindowTitle,TEXT("]")); break; - case MODE_STEPPING: _tcscat(g_pAppleWindowTitle,TEXT(" [")); _tcscat(g_pAppleWindowTitle,TITLE_STEPPING); _tcscat(g_pAppleWindowTitle,TEXT("]")); break; + case MODE_PAUSED : g_pAppleWindowTitle += std::string(TEXT(" [")) + TITLE_PAUSED + TEXT("]"); break; + case MODE_STEPPING: g_pAppleWindowTitle += std::string(TEXT(" [")) + TITLE_STEPPING + TEXT("]"); break; } } @@ -1022,7 +1022,7 @@ static void DrawStatusArea (HDC passdc, int drawflags) if (drawflags & DRAW_TITLE) { GetAppleWindowTitle(); // SetWindowText() // WindowTitle - SendMessage(g_hFrameWindow,WM_SETTEXT,0,(LPARAM)g_pAppTitle); + SendMessage(g_hFrameWindow,WM_SETTEXT,0,(LPARAM)g_pAppTitle.c_str()); } if (drawflags & DRAW_BUTTON_DRIVES) @@ -2588,7 +2588,7 @@ void FrameCreateWindow(void) // NB. g_hFrameWindow also set by WM_CREATE - NB. CreateWindow() must synchronously send WM_CREATE g_hFrameWindow = CreateWindow( TEXT("APPLE2FRAME"), - g_pAppTitle, + g_pAppTitle.c_str(), WS_OVERLAPPED | WS_CAPTION | WS_SYSMENU | WS_MINIMIZEBOX | WS_VISIBLE, nXPos, nYPos, nWidth, nHeight, diff --git a/source/Memory.cpp b/source/Memory.cpp index 95df5dce..52b122a6 100644 --- a/source/Memory.cpp +++ b/source/Memory.cpp @@ -1438,7 +1438,7 @@ void MemInitialize() GetDesktopWindow(), TEXT("The emulator was unable to allocate the memory it ") TEXT("requires. Further execution is not possible."), - g_pAppTitle, + g_pAppTitle.c_str(), MB_ICONSTOP | MB_SETFOREGROUND); ExitProcess(1); } @@ -1451,7 +1451,7 @@ void MemInitialize() TEXT("system. While changing the attributes of a memory ") TEXT("object, the operating system also changed its ") TEXT("location."), - g_pAppTitle, + g_pAppTitle.c_str(), MB_ICONEXCLAMATION | MB_SETFOREGROUND); // memimage has been freed @@ -1535,7 +1535,7 @@ void MemInitializeROM(void) MessageBox( GetDesktopWindow(), sText, - g_pAppTitle, + g_pAppTitle.c_str(), MB_ICONSTOP | MB_SETFOREGROUND); ExitProcess(1);