Large set of changes to restore CiderPress build.

CiderPress and MDC now compile, and execute far enough to open
their respective "about" boxes, but I doubt they'll do much
more than that.

* Switch from MBCS to UNICODE APIs

Microsoft switched to UTF-16 (by way of UCS-2) a long time ago,
and the support for MBCS seems to be getting phased out.  So it's
time to switch to wide strings.

This is a bit awkward for CiderPress because it works with disk
and file archives with 8-bit filenames, and I want NufxLib and
DiskImgLib to continue to work on Linux (which has largely taken
the UTF-8 approach to Unicode).  The libraries will continue to
work with 8-bit filenames, with CiderPress/MDC doing the
conversion at the appropriate point.

There were a couple of places where strings from a structure
handed back by one of the libraries were used directly in the UI,
or vice-versa, which is a problem because we have nowhere to
store the result of the conversion.  These currently have fixed
place-holder "xyzzy" strings.

All UI strings are now wide.

Various format strings now use "%ls" and "%hs" to explicitly
specify wide and narrow.  This doesn't play well with gcc, so
only the Windows-specific parts use those.

* Various updates to vcxproj files

The project-file conversion had some cruft that is now largely
gone.  The build now has a common output directory for the EXEs
and libraries, avoiding the old post-build copy steps.

* Added zlib 1.2.8 and nufxlib 2.2.2 source snapshots

The old "prebuilts" directory is now gone.  The libraries are now
built as part of building the apps.

I added a minimal set of files for zlib, and a full set for nufxlib.
The Linux-specific nufxlib goodies are included for the benefit of
the Linux utilities, which are currently broken (don't build).

* Replace symbols used for include guards

Symbols with a leading "__" are reserved.
This commit is contained in:
Andy McFadden 2014-11-10 15:32:55 -08:00
parent 63b9996009
commit 51b5f00f5c
292 changed files with 57242 additions and 7887 deletions

23
CP.sln
View File

@ -1,12 +1,21 @@
Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 2013
VisualStudioVersion = 12.0.30501.0
VisualStudioVersion = 12.0.30723.0
MinimumVisualStudioVersion = 10.0.40219.1
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "app", "app\app.vcxproj", "{B023611B-7086-46E1-847B-3B21C4732384}"
ProjectSection(ProjectDependencies) = postProject
{B66109F4-217B-43C0-86AA-EB55657E5AC0} = {B66109F4-217B-43C0-86AA-EB55657E5AC0}
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "diskimg", "diskimg\diskimg.vcxproj", "{0CFE6FAD-0126-4E99-8625-C807D1D2AAF4}"
ProjectSection(ProjectDependencies) = postProject
{B66109F4-217B-43C0-86AA-EB55657E5AC0} = {B66109F4-217B-43C0-86AA-EB55657E5AC0}
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mdc", "mdc\mdc.vcxproj", "{7DF41D71-C8DC-48AA-B372-4613210310A4}"
ProjectSection(ProjectDependencies) = postProject
{B66109F4-217B-43C0-86AA-EB55657E5AC0} = {B66109F4-217B-43C0-86AA-EB55657E5AC0}
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "util", "util\util.vcxproj", "{04BFAE2A-7AB3-4B63-B4AB-42FF1D6AD3C5}"
EndProject
@ -14,6 +23,10 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libhfs", "diskimg\libhfs\li
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "reformat", "reformat\reformat.vcxproj", "{18BCF397-397E-460C-A1DC-3E26798966E4}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "zlib", "zlib\zlib.vcxproj", "{B66109F4-217B-43C0-86AA-EB55657E5AC0}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "nufxlib", "nufxlib\nufxlib.vcxproj", "{C48AE53B-3DCB-43B1-9207-B7C5B6BB78AF}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Win32 = Debug|Win32
@ -44,6 +57,14 @@ Global
{18BCF397-397E-460C-A1DC-3E26798966E4}.Debug|Win32.Build.0 = Debug|Win32
{18BCF397-397E-460C-A1DC-3E26798966E4}.Release|Win32.ActiveCfg = Release|Win32
{18BCF397-397E-460C-A1DC-3E26798966E4}.Release|Win32.Build.0 = Release|Win32
{B66109F4-217B-43C0-86AA-EB55657E5AC0}.Debug|Win32.ActiveCfg = Debug|Win32
{B66109F4-217B-43C0-86AA-EB55657E5AC0}.Debug|Win32.Build.0 = Debug|Win32
{B66109F4-217B-43C0-86AA-EB55657E5AC0}.Release|Win32.ActiveCfg = Release|Win32
{B66109F4-217B-43C0-86AA-EB55657E5AC0}.Release|Win32.Build.0 = Release|Win32
{C48AE53B-3DCB-43B1-9207-B7C5B6BB78AF}.Debug|Win32.ActiveCfg = Debug|Win32
{C48AE53B-3DCB-43B1-9207-B7C5B6BB78AF}.Debug|Win32.Build.0 = Debug|Win32
{C48AE53B-3DCB-43B1-9207-B7C5B6BB78AF}.Release|Win32.ActiveCfg = Release|Win32
{C48AE53B-3DCB-43B1-9207-B7C5B6BB78AF}.Release|Win32.Build.0 = Release|Win32
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE

View File

@ -111,7 +111,7 @@ AcuEntry::ExtractThreadToBuffer(int which, char** ppText, long* pLength,
errno = 0;
if (fseek(fpArchive->fFp, fOffset, SEEK_SET) < 0) {
pErrMsg->Format("Unable to seek to offset %ld: %s",
pErrMsg->Format(L"Unable to seek to offset %ld: %hs",
fOffset, strerror(errno));
goto bail;
}
@ -120,7 +120,7 @@ AcuEntry::ExtractThreadToBuffer(int which, char** ppText, long* pLength,
nerr = UnSqueeze(fpArchive->fFp, (unsigned long) GetCompressedLen(),
&expBuf, false, 0);
if (nerr != kNuErrNone) {
pErrMsg->Format("File read failed: %s", NuStrError(nerr));
pErrMsg->Format(L"File read failed: %hs", NuStrError(nerr));
goto bail;
}
@ -146,7 +146,7 @@ AcuEntry::ExtractThreadToBuffer(int which, char** ppText, long* pLength,
*pLength = unsqLen;
} else {
if (*pLength < unsqLen) {
pErrMsg->Format("buf size %ld too short (%ld)",
pErrMsg->Format(L"buf size %ld too short (%ld)",
*pLength, unsqLen);
delete[] unsqBuf;
goto bail;
@ -162,19 +162,19 @@ AcuEntry::ExtractThreadToBuffer(int which, char** ppText, long* pLength,
if (needAlloc) {
dataBuf = new char[len];
if (dataBuf == nil) {
pErrMsg->Format("allocation of %ld bytes failed", len);
pErrMsg->Format(L"allocation of %ld bytes failed", len);
goto bail;
}
} else {
if (*pLength < (long) len) {
pErrMsg->Format("buf size %ld too short (%ld)",
pErrMsg->Format(L"buf size %ld too short (%ld)",
*pLength, len);
goto bail;
}
dataBuf = *ppText;
}
if (fread(dataBuf, len, 1, fpArchive->fFp) != 1) {
pErrMsg->Format("File read failed: %s", strerror(errno));
pErrMsg->Format(L"File read failed: %hs", strerror(errno));
goto bail;
}
@ -217,7 +217,7 @@ AcuEntry::ExtractThreadToFile(int which, FILE* outfp, ConvertEOL conv,
ASSERT(IDOK != -1 && IDCANCEL != -1);
if (which != kDataThread) {
*pErrMsg = "No such fork";
*pErrMsg = L"No such fork";
goto bail;
}
@ -230,7 +230,7 @@ AcuEntry::ExtractThreadToFile(int which, FILE* outfp, ConvertEOL conv,
errno = 0;
if (fseek(fpArchive->fFp, fOffset, SEEK_SET) < 0) {
pErrMsg->Format("Unable to seek to offset %ld: %s",
pErrMsg->Format(L"Unable to seek to offset %ld: %hs",
fOffset, strerror(errno));
goto bail;
}
@ -255,7 +255,7 @@ AcuEntry::ExtractThreadToFile(int which, FILE* outfp, ConvertEOL conv,
nerr = UnSqueeze(fpArchive->fFp, (unsigned long) GetCompressedLen(),
&expBuf, false, 0);
if (nerr != kNuErrNone) {
pErrMsg->Format("File read failed: %s", NuStrError(nerr));
pErrMsg->Format(L"File read failed: %hs", NuStrError(nerr));
goto bail;
}
@ -273,7 +273,7 @@ AcuEntry::ExtractThreadToFile(int which, FILE* outfp, ConvertEOL conv,
int err = GenericEntry::WriteConvert(outfp, buf, uncLen, &conv,
&convHA, &lastCR);
if (err != 0) {
pErrMsg->Format("File write failed: %s", strerror(err));
pErrMsg->Format(L"File write failed: %hs", strerror(err));
delete[] buf;
goto bail;
}
@ -283,7 +283,7 @@ AcuEntry::ExtractThreadToFile(int which, FILE* outfp, ConvertEOL conv,
nerr = CopyData(outfp, conv, convHA, pErrMsg);
if (nerr != kNuErrNone) {
if (pErrMsg->IsEmpty()) {
pErrMsg->Format("Failed while copying data: %s\n",
pErrMsg->Format(L"Failed while copying data: %hs\n",
NuStrError(nerr));
}
goto bail;
@ -329,7 +329,7 @@ AcuEntry::CopyData(FILE* outfp, ConvertEOL conv, ConvertHighASCII convHA,
/* read a chunk from the source file */
nerr = fpArchive->AcuRead(buf, chunkLen);
if (nerr != kNuErrNone) {
pMsg->Format("File read failed: %s.", NuStrError(nerr));
pMsg->Format(L"File read failed: %hs.", NuStrError(nerr));
goto bail;
}
@ -337,7 +337,7 @@ AcuEntry::CopyData(FILE* outfp, ConvertEOL conv, ConvertHighASCII convHA,
int err = GenericEntry::WriteConvert(outfp, buf, chunkLen, &conv,
&convHA, &lastCR);
if (err != 0) {
pMsg->Format("File write failed: %s.", strerror(err));
pMsg->Format(L"File write failed: %hs.", strerror(err));
nerr = kNuErrGeneric;
goto bail;
}
@ -372,7 +372,7 @@ AcuEntry::TestEntry(CWnd* pMsgWnd)
errno = 0;
if (fseek(fpArchive->fFp, fOffset, SEEK_SET) < 0) {
nerr = kNuErrGeneric;
errMsg.Format("Unable to seek to offset %ld: %s\n",
errMsg.Format(L"Unable to seek to offset %ld: %hs\n",
fOffset, strerror(errno));
ShowFailureMsg(pMsgWnd, errMsg, IDS_FAILED);
goto bail;
@ -382,7 +382,7 @@ AcuEntry::TestEntry(CWnd* pMsgWnd)
nerr = UnSqueeze(fpArchive->fFp, (unsigned long) GetCompressedLen(),
nil, false, 0);
if (nerr != kNuErrNone) {
errMsg.Format("Unsqueeze failed: %s.", NuStrError(nerr));
errMsg.Format(L"Unsqueeze failed: %hs.", NuStrError(nerr));
ShowFailureMsg(pMsgWnd, errMsg, IDS_FAILED);
goto bail;
}
@ -390,7 +390,7 @@ AcuEntry::TestEntry(CWnd* pMsgWnd)
errno = 0;
if (fseek(fpArchive->fFp, fOffset + len, SEEK_SET) < 0) {
nerr = kNuErrGeneric;
errMsg.Format("Unable to seek to offset %ld (file truncated?): %s\n",
errMsg.Format(L"Unable to seek to offset %ld (file truncated?): %hs\n",
fOffset, strerror(errno));
ShowFailureMsg(pMsgWnd, errMsg, IDS_FAILED);
goto bail;
@ -428,16 +428,16 @@ AcuArchive::AppInit(void)
* Returns an error string on failure, or "" on success.
*/
GenericArchive::OpenResult
AcuArchive::Open(const char* filename, bool readOnly, CString* pErrMsg)
AcuArchive::Open(const WCHAR* filename, bool readOnly, CString* pErrMsg)
{
CString errMsg;
fIsReadOnly = true; // ignore "readOnly"
errno = 0;
fFp = fopen(filename, "rb");
fFp = _wfopen(filename, L"rb");
if (fFp == nil) {
errMsg.Format("Unable to open %s: %s.", filename, strerror(errno));
errMsg.Format(L"Unable to open %ls: %hs.", filename, strerror(errno));
goto bail;
}
@ -447,10 +447,10 @@ AcuArchive::Open(const char* filename, bool readOnly, CString* pErrMsg)
result = LoadContents();
if (result < 0) {
errMsg.Format("The file is not an ACU archive.");
errMsg.Format(L"The file is not an ACU archive.");
goto bail;
} else if (result > 0) {
errMsg.Format("Failed while reading data from ACU archive.");
errMsg.Format(L"Failed while reading data from ACU archive.");
goto bail;
}
}
@ -471,10 +471,9 @@ bail:
* Returns an error string on failure, or "" on success.
*/
CString
AcuArchive::New(const char* /*filename*/, const void* /*options*/)
AcuArchive::New(const WCHAR* /*filename*/, const void* /*options*/)
{
CString retmsg("Sorry, AppleLink Compression Utility files can't be created.");
return retmsg;
return L"Sorry, AppleLink Compression Utility files can't be created.";
}
@ -572,7 +571,7 @@ AcuArchive::Reload(void)
DeleteEntries();
if (LoadContents() != 0) {
return "Reload failed.";
return L"Reload failed.";
}
return "";
@ -703,14 +702,14 @@ AcuArchive::DumpFileHeader(const AcuFileEntry* pEntry)
FormatDate(createWhen, &createStr);
FormatDate(modWhen, &modStr);
WMSG1(" Header for file '%s':\n", pEntry->fileName);
WMSG1(" Header for file '%hs':\n", pEntry->fileName);
WMSG4(" dataStorageLen=%d eof=%d blockCount=%d checksum=0x%04x\n",
pEntry->dataStorageLen, pEntry->dataEof, pEntry->blockCount,
pEntry->dataChecksum);
WMSG4(" fileType=0x%02x auxType=0x%04x storageType=0x%02x access=0x%04x\n",
pEntry->fileType, pEntry->auxType, pEntry->storageType, pEntry->access);
WMSG2(" created %s, modified %s\n", (const char*) createStr,
(const char*) modStr);
WMSG2(" created %ls, modified %ls\n",
(LPCWSTR) createStr, (LPCWSTR) modStr);
WMSG2(" fileNameLen=%d headerChecksum=0x%04x\n",
pEntry->fileNameLen, pEntry->headerChecksum);
}
@ -730,7 +729,8 @@ AcuArchive::CreateEntry(const AcuFileEntry* pEntry)
* Create the new entry.
*/
pNewEntry = new AcuEntry(this);
pNewEntry->SetPathName(pEntry->fileName);
CString fileName(pEntry->fileName);
pNewEntry->SetPathName(fileName);
pNewEntry->SetFssep(kAcuFssep);
pNewEntry->SetFileType(pEntry->fileType);
pNewEntry->SetAuxType(pEntry->auxType);
@ -753,12 +753,12 @@ AcuArchive::CreateEntry(const AcuFileEntry* pEntry)
pNewEntry->SetDataForkLen(pEntry->dataEof);
if (pEntry->compressionType == kAcuCompNone) {
pNewEntry->SetFormatStr("Uncompr");
pNewEntry->SetFormatStr(L"Uncompr");
} else if (pEntry->compressionType == kAcuCompSqueeze) {
pNewEntry->SetFormatStr("Squeeze");
pNewEntry->SetFormatStr(L"Squeeze");
pNewEntry->SetSqueezed(true);
} else {
pNewEntry->SetFormatStr("(unknown)");
pNewEntry->SetFormatStr(L"(unknown)");
pNewEntry->SetSqueezed(false);
}
@ -870,7 +870,7 @@ AcuArchive::TestSelection(CWnd* pMsgWnd, SelectionSet* pSelSet)
while (pSelEntry != nil) {
pEntry = (AcuEntry*) pSelEntry->GetEntry();
WMSG2(" Testing '%s' (offset=%ld)\n", pEntry->GetDisplayName(),
WMSG2(" Testing '%hs' (offset=%ld)\n", pEntry->GetDisplayName(),
pEntry->GetOffset());
SET_PROGRESS_UPDATE2(0, pEntry->GetDisplayName(), nil);
@ -883,7 +883,7 @@ AcuArchive::TestSelection(CWnd* pMsgWnd, SelectionSet* pSelSet)
errMsg = "Cancelled.";
pMsgWnd->MessageBox(errMsg, title, MB_OK);
} else {
errMsg.Format("Failed while testing '%s': %s.",
errMsg.Format(L"Failed while testing '%hs': %hs.",
pEntry->GetPathName(), NuStrError(nerr));
ShowFailureMsg(pMsgWnd, errMsg, IDS_FAILED);
}
@ -894,9 +894,9 @@ AcuArchive::TestSelection(CWnd* pMsgWnd, SelectionSet* pSelSet)
}
/* show success message */
errMsg.Format("Tested %d file%s, no errors found.",
errMsg.Format(L"Tested %d file%ls, no errors found.",
pSelSet->GetNumEntries(),
pSelSet->GetNumEntries() == 1 ? "" : "s");
pSelSet->GetNumEntries() == 1 ? L"" : L"s");
pMsgWnd->MessageBox(errMsg);
retVal = true;

View File

@ -6,8 +6,8 @@
/*
* AppleLink Compression Utility archive support.
*/
#ifndef __ACU_ARCHIVE__
#define __ACU_ARCHIVE__
#ifndef APP_ACUARCHIVE_H
#define APP_ACUARCHIVE_H
#include "GenericArchive.h"
@ -69,9 +69,9 @@ public:
// One-time initialization; returns an error string.
static CString AppInit(void);
virtual OpenResult Open(const char* filename, bool readOnly,
virtual OpenResult Open(const WCHAR* filename, bool readOnly,
CString* pErrMsg);
virtual CString New(const char* filename, const void* options);
virtual CString New(const WCHAR* filename, const void* options);
virtual CString Flush(void) { return ""; }
virtual CString Reload(void);
virtual bool IsReadOnly(void) const { return fIsReadOnly; };
@ -84,7 +84,7 @@ public:
const AddFilesDialog* pAddOpts)
{ ASSERT(false); return false; }
virtual bool CreateSubdir(CWnd* pMsgWnd, GenericEntry* pParentEntry,
const char* newName)
const WCHAR* newName)
{ ASSERT(false); return false; }
virtual bool TestSelection(CWnd* pMsgWnd, SelectionSet* pSelSet);
virtual bool DeleteSelection(CWnd* pMsgWnd, SelectionSet* pSelSet)
@ -92,10 +92,10 @@ public:
virtual bool RenameSelection(CWnd* pMsgWnd, SelectionSet* pSelSet)
{ ASSERT(false); return false; }
virtual bool RenameVolume(CWnd* pMsgWnd, DiskFS* pDiskFS,
const char* newName)
const WCHAR* newName)
{ ASSERT(false); return false; }
virtual CString TestVolumeName(const DiskFS* pDiskFS,
const char* newName) const
const WCHAR* newName) const
{ ASSERT(false); return "!"; }
virtual CString TestPathName(const GenericEntry* pGenericEntry,
const CString& basePath, const CString& newName, char newFssep) const
@ -219,4 +219,4 @@ private:
bool fIsReadOnly;
};
#endif /*__ACU_ARCHIVE__*/
#endif /*APP_ACUARCHIVE_H*/

View File

@ -12,10 +12,9 @@
#include "HelpTopics.h"
#include "MyApp.h"
#include "resource.h"
#include "../prebuilt/NufxLib.h"
#include "../nufxlib/NufxLib.h"
#include "../diskimg/DiskImg.h"
#define ZLIB_DLL
#include "../prebuilt/zlib.h"
#include "../zlib/zlib.h"
BEGIN_MESSAGE_MAP(AboutDialog, CDialog)
@ -23,16 +22,16 @@ BEGIN_MESSAGE_MAP(AboutDialog, CDialog)
//ON_BN_CLICKED(IDC_ABOUT_ENTER_REG, OnEnterReg)
END_MESSAGE_MAP()
static const char* kVersionExtra =
static const WCHAR kVersionExtra[] =
#ifdef _DEBUG
" _DEBUG"
L" _DEBUG"
#else
""
L""
#endif
#ifdef _DEBUG_LOG
" _LOG"
L" _LOG"
#else
""
L""
#endif
;
@ -80,7 +79,8 @@ AboutDialog::OnInitDialog(void)
pStatic = (CStatic*) GetDlgItem(IDC_ZLIB_VERS_TEXT);
ASSERT(pStatic != nil);
pStatic->GetWindowText(tmpStr);
newVersion.Format(tmpStr, zlibVersion());
CString zlibVersionStr(zlibVersion());
newVersion.Format(tmpStr, zlibVersionStr);
pStatic->SetWindowText(newVersion);
/* and, finally, the ASPI version */
@ -89,7 +89,7 @@ AboutDialog::OnInitDialog(void)
if (DiskImgLib::Global::GetHasASPI()) {
CString versionStr;
DWORD version = DiskImgLib::Global::GetASPIVersion();
versionStr.Format("%d.%d.%d.%d",
versionStr.Format(L"%d.%d.%d.%d",
version & 0x0ff,
(version >> 8) & 0xff,
(version >> 16) & 0xff,

View File

@ -6,8 +6,8 @@
/*
* Class definition for About dialog.
*/
#ifndef __ABOUT_DIALOG__
#define __ABOUT_DIALOG__
#ifndef APP_ABOUTDIALOG_H
#define APP_ABOUTDIALOG_H
//#include <afxwin.h>
#include "resource.h"
@ -34,4 +34,4 @@ protected:
DECLARE_MESSAGE_MAP()
};
#endif /*__ABOUT_DIALOG__*/
#endif /*APP_ABOUTDIALOG_H*/

View File

@ -100,7 +100,7 @@ ActionProgressDialog::OnInitDialog(void)
* Set the name of the file as it appears in the archive.
*/
void
ActionProgressDialog::SetArcName(const char* str)
ActionProgressDialog::SetArcName(const WCHAR* str)
{
CString oldStr;
@ -127,7 +127,7 @@ ActionProgressDialog::GetFileName(void)
* Set the name of the file as it appears under Windows.
*/
void
ActionProgressDialog::SetFileName(const char* str)
ActionProgressDialog::SetFileName(const WCHAR* str)
{
CString oldStr;

View File

@ -6,8 +6,8 @@
/*
* Show the progress of an action like "add" or "extract".
*/
#ifndef __ACTIONPROGRESSDIALOG__
#define __ACTIONPROGRESSDIALOG__
#ifndef APP_ACTIONPROGRESSDIALOG_H
#define APP_ACTIONPROGRESSDIALOG_H
#include "resource.h"
@ -48,8 +48,8 @@ public:
DestroyWindow();
}
void SetArcName(const char* str);
void SetFileName(const char* str);
void SetArcName(const WCHAR* str);
void SetFileName(const WCHAR* str);
const CString GetFileName(void);
int SetProgress(int perc);
@ -62,4 +62,4 @@ private:
DECLARE_MESSAGE_MAP()
};
#endif /*__ACTIONPROGRESSDIALOG__*/
#endif /*APP_ACTIONPROGRESSDIALOG_H*/

View File

@ -82,8 +82,8 @@ MainWindow::HandleView(void)
selSet.Dump();
if (selSet.GetNumEntries() == 0) {
MessageBox("Nothing viewable found.",
"No match", MB_OK | MB_ICONEXCLAMATION);
MessageBox(L"Nothing viewable found.",
L"No match", MB_OK | MB_ICONEXCLAMATION);
return;
}
@ -101,7 +101,7 @@ MainWindow::HandleView(void)
// remember which font they used (sticky pref, not in registry)
fPreferences.SetPrefString(kPrViewTextTypeFace, vfd.GetTextTypeFace());
fPreferences.SetPrefLong(kPrViewTextPointSize, vfd.GetTextPointSize());
WMSG2("Preferences: saving view font %d-point '%s'\n",
WMSG2("Preferences: saving view font %d-point '%ls'\n",
fPreferences.GetPrefLong(kPrViewTextPointSize),
fPreferences.GetPrefString(kPrViewTextTypeFace));
}
@ -364,8 +364,8 @@ MainWindow::OnActionsAddDisks(void)
openFilters = kOpenDiskImage;
openFilters += kOpenAll;
openFilters += kOpenEnd;
CFileDialog dlg(TRUE, "dsk", NULL, OFN_FILEMUSTEXIST, openFilters, this);
dlg.m_ofn.lpstrTitle = "Add Disk Image";
CFileDialog dlg(TRUE, L"dsk", NULL, OFN_FILEMUSTEXIST, openFilters, this);
dlg.m_ofn.lpstrTitle = L"Add Disk Image";
/* file is always opened read-only */
dlg.m_ofn.Flags |= OFN_HIDEREADONLY;
@ -381,14 +381,14 @@ MainWindow::OnActionsAddDisks(void)
/* open the image file and analyze it */
dierr = img.OpenImage(dlg.GetPathName(), PathProposal::kLocalFssep, true);
if (dierr != kDIErrNone) {
errMsg.Format("Unable to open disk image: %s.",
errMsg.Format(L"Unable to open disk image: %hs.",
DiskImgLib::DIStrError(dierr));
MessageBox(errMsg, failed, MB_OK|MB_ICONSTOP);
goto bail;
}
if (img.AnalyzeImage() != kDIErrNone) {
errMsg.Format("The file '%s' doesn't seem to hold a valid disk image.",
errMsg.Format(L"The file '%ls' doesn't seem to hold a valid disk image.",
dlg.GetPathName());
MessageBox(errMsg, failed, MB_OK|MB_ICONSTOP);
goto bail;
@ -426,8 +426,8 @@ MainWindow::OnActionsAddDisks(void)
dierr = img.OverrideFormat(img.GetPhysicalFormat(), imf.fFSFormat,
imf.fSectorOrder);
if (dierr != kDIErrNone) {
errMsg.Format("Unable to access disk image using selected"
" parameters. Error: %s.",
errMsg.Format(L"Unable to access disk image using selected"
L" parameters. Error: %hs.",
DiskImgLib::DIStrError(dierr));
MessageBox(errMsg, failed, MB_OK | MB_ICONSTOP);
goto bail;
@ -444,7 +444,7 @@ MainWindow::OnActionsAddDisks(void)
dierr = img.OverrideFormat(img.GetPhysicalFormat(),
DiskImg::kFormatGenericProDOSOrd, img.GetSectorOrder());
if (dierr != kDIErrNone) {
errMsg.Format("Internal error: couldn't switch to generic ProDOS: %s.",
errMsg.Format(L"Internal error: couldn't switch to generic ProDOS: %hs.",
DiskImgLib::DIStrError(dierr));
MessageBox(errMsg, failed, MB_OK | MB_ICONSTOP);
goto bail;
@ -459,7 +459,7 @@ MainWindow::OnActionsAddDisks(void)
*/
ASSERT(dlg.m_ofn.nFileOffset > 0);
int len;
len = strlen(dlg.m_ofn.lpstrFile) + 2;
len = wcslen(dlg.m_ofn.lpstrFile) + 2;
dlg.m_ofn.lpstrFile[dlg.m_ofn.nFileOffset-1] = '\0';
addOpts.SetFileNames(dlg.m_ofn.lpstrFile, len, dlg.m_ofn.nFileOffset);
addOpts.fStoragePrefix = "";
@ -535,7 +535,7 @@ MainWindow::OnActionsCreateSubdir(void)
return;
}
WMSG1("Creating subdir in '%s'\n", pEntry->GetPathName());
WMSG1("Creating subdir in '%ls'\n", pEntry->GetPathName());
csDialog.fBasePath = pEntry->GetPathName();
csDialog.fpArchive = fpOpenArchive;
@ -544,7 +544,7 @@ MainWindow::OnActionsCreateSubdir(void)
if (csDialog.DoModal() != IDOK)
return;
WMSG1("Creating '%s'\n", csDialog.fNewName);
WMSG1("Creating '%ls'\n", (LPCWSTR) csDialog.fNewName);
fpOpenArchive->CreateSubdir(this, pEntry, csDialog.fNewName);
fpContentList->Reload();
@ -630,7 +630,7 @@ MainWindow::OnActionsExtract(void)
fPreferences.SetPrefBool(kPrExtractStripFolderNames, extOpts.fStripFolderNames != 0);
fPreferences.SetPrefBool(kPrExtractOverwriteExisting, extOpts.fOverwriteExisting != 0);
WMSG1("Requested extract path is '%s'\n", extOpts.fExtractPath);
WMSG1("Requested extract path is '%ls'\n", (LPCWSTR) extOpts.fExtractPath);
/*
* Create a "selection set" of things to display.
@ -652,8 +652,8 @@ MainWindow::OnActionsExtract(void)
//selSet.Dump();
if (selSet.GetNumEntries() == 0) {
MessageBox("No files matched the selection criteria.",
"No match", MB_OK | MB_ICONEXCLAMATION);
MessageBox(L"No files matched the selection criteria.",
L"No match", MB_OK | MB_ICONEXCLAMATION);
return;
}
@ -711,7 +711,7 @@ MainWindow::DoBulkExtract(SelectionSet* pSelSet,
GenericEntry* pEntry = pSelEntry->GetEntry();
if (pEntry->GetDamaged()) {
WMSG1("Skipping '%s' due to damage\n", pEntry->GetPathName());
WMSG1("Skipping '%ls' due to damage\n", pEntry->GetPathName());
continue;
}
@ -737,7 +737,7 @@ MainWindow::DoBulkExtract(SelectionSet* pSelSet,
pEntry->GetRecordKind() == GenericEntry::kRecordKindForkedFile))
{
fpActionProgress->SetArcName(pEntry->GetDisplayName());
fpActionProgress->SetFileName(_T("-"));
fpActionProgress->SetFileName(L"-");
SET_PROGRESS_BEGIN();
if (GetFileParts(pEntry, &pHolder) == 0) {
@ -759,7 +759,7 @@ MainWindow::DoBulkExtract(SelectionSet* pSelSet,
pEntry->GetFileType(),
pEntry->GetAuxType(),
ReformatterSourceFormat(pEntry->GetSourceFS()),
pEntry->GetFileNameExtension());
pEntry->GetFileNameExtensionA());
pHolder->TestApplicability();
}
}
@ -869,7 +869,7 @@ MainWindow::ExtractEntry(GenericEntry* pEntry, int thread,
{
extractAs2MG = true;
} else {
WMSG2("Not extracting funky image '%s' as 2MG (len=%ld)\n",
WMSG2("Not extracting funky image '%ls' as 2MG (len=%ld)\n",
pEntry->GetPathName(), pEntry->GetUncompressedLen());
}
}
@ -970,20 +970,20 @@ MainWindow::ExtractEntry(GenericEntry* pEntry, int thread,
*/
switch (pOutput->GetOutputKind()) {
case ReformatOutput::kOutputText:
if (lastFour.CompareNoCase(".txt") != 0)
tmpPath += ".txt";
if (lastFour.CompareNoCase(L".txt") != 0)
tmpPath += L".txt";
break;
case ReformatOutput::kOutputRTF:
if (lastFour.CompareNoCase(".rtf") != 0)
tmpPath += ".rtf";
if (lastFour.CompareNoCase(L".rtf") != 0)
tmpPath += L".rtf";
break;
case ReformatOutput::kOutputCSV:
if (lastFour.CompareNoCase(".csv") != 0)
tmpPath += ".csv";
if (lastFour.CompareNoCase(L".csv") != 0)
tmpPath += L".csv";
break;
case ReformatOutput::kOutputBitmap:
if (lastFour.CompareNoCase(".bmp") != 0)
tmpPath += ".bmp";
if (lastFour.CompareNoCase(L".bmp") != 0)
tmpPath += L".bmp";
break;
case ReformatOutput::kOutputRaw:
noChangePath = true;
@ -1011,12 +1011,12 @@ MainWindow::ExtractEntry(GenericEntry* pEntry, int thread,
*/
outputPath = adjustedExtractPath;
outputPath += convName;
outputPath += ".2mg";
outputPath += L".2mg";
}
/* update the display in case we renamed it */
if (outputPath != fpActionProgress->GetFileName()) {
WMSG2(" Renamed our output, from '%s' to '%s'\n",
WMSG2(" Renamed our output, from '%ls' to '%ls'\n",
(LPCTSTR) fpActionProgress->GetFileName(), outputPath);
fpActionProgress->SetFileName(outputPath);
}
@ -1026,7 +1026,7 @@ MainWindow::ExtractEntry(GenericEntry* pEntry, int thread,
*/
fpActionProgress->SetArcName(pathProp.fStoredPathName);
fpActionProgress->SetFileName(outputPath);
WMSG2("Extracting from '%s' to '%s'\n",
WMSG2("Extracting from '%ls' to '%ls'\n",
pathProp.fStoredPathName, outputPath);
SET_PROGRESS_BEGIN();
@ -1048,8 +1048,8 @@ MainWindow::ExtractEntry(GenericEntry* pEntry, int thread,
/* update the display in case they renamed the file */
if (outputPath != fpActionProgress->GetFileName()) {
WMSG2(" Detected rename, from '%s' to '%s'\n",
(LPCTSTR) fpActionProgress->GetFileName(), outputPath);
WMSG2(" Detected rename, from '%ls' to '%ls'\n",
(LPCWSTR) fpActionProgress->GetFileName(), outputPath);
fpActionProgress->SetFileName(outputPath);
}
@ -1082,7 +1082,7 @@ MainWindow::ExtractEntry(GenericEntry* pEntry, int thread,
ASSERT(ftell(fp) == 0);
err = header.WriteHeader(fp);
if (err != 0) {
errMsg.Format("Unable to save 2MG file '%s': %s\n",
errMsg.Format(L"Unable to save 2MG file '%ls': %hs\n",
outputPath, strerror(err));
fpActionProgress->MessageBox(errMsg, failed,
MB_OK | MB_ICONERROR);
@ -1166,7 +1166,7 @@ MainWindow::ExtractEntry(GenericEntry* pEntry, int thread,
pOutput->GetTextLen(), 1, fp) != 1)
err = errno;
if (err != 0) {
errMsg.Format("Unable to save reformatted file '%s': %s\n",
errMsg.Format(L"Unable to save reformatted file '%ls': %hs\n",
outputPath, strerror(err));
fpActionProgress->MessageBox(errMsg, failed,
MB_OK | MB_ICONERROR);
@ -1179,7 +1179,7 @@ MainWindow::ExtractEntry(GenericEntry* pEntry, int thread,
ASSERT(pOutput->GetDIB() != nil);
int err = pOutput->GetDIB()->WriteToFile(fp);
if (err != 0) {
errMsg.Format("Unable to save bitmap '%s': %s\n",
errMsg.Format(L"Unable to save bitmap '%ls': %hs\n",
outputPath, strerror(err));
fpActionProgress->MessageBox(errMsg, failed,
MB_OK | MB_ICONERROR);
@ -1205,7 +1205,7 @@ MainWindow::ExtractEntry(GenericEntry* pEntry, int thread,
err = GenericEntry::WriteConvert(fp, pOutput->GetTextBuf(),
pOutput->GetTextLen(), &thisConv, &thisConvHA, &lastCR);
if (err != 0) {
errMsg.Format("Unable to write file '%s': %s\n",
errMsg.Format(L"Unable to write file '%ls': %hs\n",
outputPath, strerror(err));
fpActionProgress->MessageBox(errMsg, failed,
MB_OK | MB_ICONERROR);
@ -1230,7 +1230,7 @@ MainWindow::ExtractEntry(GenericEntry* pEntry, int thread,
CString msg;
int result;
ASSERT(fpActionProgress != nil);
WMSG3("Extracting '%s', requesting thisConv=%d, convHA=%d\n",
WMSG3("Extracting '%ls', requesting thisConv=%d, convHA=%d\n",
outputPath, thisConv, convHA);
result = pEntry->ExtractThreadToFile(thread, fp,
thisConv, convHA, &msg);
@ -1239,11 +1239,11 @@ MainWindow::ExtractEntry(GenericEntry* pEntry, int thread,
CString msg;
msg.LoadString(IDS_OPERATION_CANCELLED);
fpActionProgress->MessageBox(msg,
"CiderPress", MB_OK | MB_ICONEXCLAMATION);
L"CiderPress", MB_OK | MB_ICONEXCLAMATION);
} else {
WMSG2(" FAILED on '%s': %s\n", outputPath, msg);
errMsg.Format("Unable to extract file '%s': %s\n",
outputPath, (LPCTSTR) msg);
WMSG2(" FAILED on '%ls': %ls\n", outputPath, msg);
errMsg.Format(L"Unable to extract file '%ls': %ls\n",
outputPath, msg);
fpActionProgress->MessageBox(errMsg, failed,
MB_OK | MB_ICONERROR);
}
@ -1309,11 +1309,11 @@ did_rename:
if (*pOverwriteExisting) {
do_overwrite:
/* delete existing */
WMSG1(" Deleting existing '%s'\n", (LPCTSTR) *pOutputPath);
if (::unlink(*pOutputPath) != 0) {
WMSG1(" Deleting existing '%ls'\n", (LPCWSTR) *pOutputPath);
if (::_wunlink(*pOutputPath) != 0) {
err = errno;
WMSG2(" Failed deleting '%s', err=%d\n",
(LPCTSTR)*pOutputPath, err);
WMSG2(" Failed deleting '%ls', err=%d\n",
(LPCWSTR)*pOutputPath, err);
if (err == ENOENT) {
/* user might have removed it while dialog was up */
err = 0;
@ -1324,7 +1324,7 @@ do_overwrite:
}
} else if (*pOvwrForAll) {
/* never overwrite */
WMSG1(" Skipping '%s'\n", (LPCTSTR) *pOutputPath);
WMSG1(" Skipping '%ls'\n", (LPCWSTR) *pOutputPath);
goto bail;
} else {
/* no firm policy, ask the user */
@ -1360,7 +1360,7 @@ do_overwrite:
if (err != 0)
goto bail;
*pFp = fopen(*pOutputPath, "wb");
*pFp = _wfopen(*pOutputPath, L"wb");
if (*pFp == nil)
err = errno ? errno : -1;
/* fall through with error */
@ -1369,14 +1369,14 @@ bail:
/* if we failed, tell the user why */
if (err == ENOTDIR) {
/* part of the output path exists, but isn't a directory */
msg.Format("Unable to create folders for '%s': part of the path "
"already exists but is not a folder.\n",
msg.Format(L"Unable to create folders for '%ls': part of the path "
L"already exists but is not a folder.\n",
*pOutputPath);
fpActionProgress->MessageBox(msg, failed, MB_OK | MB_ICONERROR);
return IDCANCEL;
} else if (err == EINVAL) {
/* invalid argument; assume it's an invalid filename */
msg.Format("Unable to create file '%s': invalid filename.\n",
msg.Format(L"Unable to create file '%ls': invalid filename.\n",
*pOutputPath);
fpActionProgress->MessageBox(msg, failed, MB_OK | MB_ICONERROR);
return IDCANCEL;
@ -1385,7 +1385,7 @@ bail:
WMSG0("Cancelling due to user request\n");
return IDCANCEL;
} else if (err != 0) {
msg.Format("Unable to create file '%s': %s\n",
msg.Format(L"Unable to create file '%ls': %hs\n",
*pOutputPath, strerror(err));
fpActionProgress->MessageBox(msg, failed, MB_OK | MB_ICONERROR);
return IDCANCEL;
@ -1445,8 +1445,8 @@ MainWindow::OnActionsTest(void)
if (selSet.GetNumEntries() == 0) {
/* should be impossible */
MessageBox("No files matched the selection criteria.",
"No match", MB_OK|MB_ICONEXCLAMATION);
MessageBox(L"No files matched the selection criteria.",
L"No match", MB_OK|MB_ICONEXCLAMATION);
return;
}
@ -1543,16 +1543,16 @@ MainWindow::OnActionsDelete(void)
selSet.CreateFromSelection(fpContentList, threadMask);
if (selSet.GetNumEntries() == 0) {
/* can happen if they selected volume dir only */
MessageBox("Nothing to delete.",
"No match", MB_OK | MB_ICONEXCLAMATION);
MessageBox(L"Nothing to delete.",
L"No match", MB_OK | MB_ICONEXCLAMATION);
return;
}
CString appName, msg;
appName.LoadString(IDS_MB_APP_NAME);
msg.Format("Delete %d file%s?", selSet.GetNumEntries(),
selSet.GetNumEntries() == 1 ? "" : "s");
msg.Format(L"Delete %d file%ls?", selSet.GetNumEntries(),
selSet.GetNumEntries() == 1 ? L"" : L"s");
if (MessageBox(msg, appName, MB_OKCANCEL | MB_ICONQUESTION) != IDOK)
return;
@ -1614,8 +1614,8 @@ MainWindow::OnActionsRename(void)
if (selSet.GetNumEntries() == 0) {
/* should be impossible */
MessageBox("No files matched the selection criteria.",
"No match", MB_OK | MB_ICONEXCLAMATION);
MessageBox(L"No files matched the selection criteria.",
L"No match", MB_OK | MB_ICONEXCLAMATION);
return;
}
@ -1863,8 +1863,8 @@ MainWindow::OnActionsRecompress(void)
if (selSet.GetNumEntries() == 0) {
/* should be impossible */
MessageBox("No files matched the selection criteria.",
"No match", MB_OK|MB_ICONEXCLAMATION);
MessageBox(L"No files matched the selection criteria.",
L"No match", MB_OK|MB_ICONEXCLAMATION);
return;
}
@ -1896,10 +1896,10 @@ MainWindow::OnActionsRecompress(void)
ASSERT(beforeUncomp == afterUncomp);
appName.LoadString(IDS_MB_APP_NAME);
msg.Format("Total uncompressed size of all files:\t%.1fK\r\n"
"Total size before recompress:\t\t%.1fK\r\n"
"Total size after recompress:\t\t%.1fK\r\n"
"Overall reduction:\t\t\t%.1fK",
msg.Format(L"Total uncompressed size of all files:\t%.1fK\r\n"
L"Total size before recompress:\t\t%.1fK\r\n"
L"Total size after recompress:\t\t%.1fK\r\n"
L"Overall reduction:\t\t\t%.1fK",
beforeUncomp / 1024.0, beforeComp / 1024.0, afterComp / 1024.0,
(beforeComp - afterComp) / 1024.0);
MessageBox(msg, appName, MB_OK|MB_ICONINFORMATION);
@ -1993,8 +1993,8 @@ MainWindow::OnActionsConvDisk(void)
if (selSet.GetNumEntries() == 0) {
/* should be impossible */
MessageBox("No files matched the selection criteria.",
"No match", MB_OK|MB_ICONEXCLAMATION);
MessageBox(L"No files matched the selection criteria.",
L"No match", MB_OK|MB_ICONEXCLAMATION);
return;
}
@ -2004,18 +2004,18 @@ MainWindow::OnActionsConvDisk(void)
//xferOpts.fUseSparseBlocks =
// fPreferences.GetPrefBool(kPrProDOSUseSparse) != 0;
WMSG1("New volume name will be '%s'\n", selOpts.fVolName);
WMSG1("New volume name will be '%ls'\n", (LPCWSTR) selOpts.fVolName);
/*
* Create a new disk image.
*/
CString filename, saveFolder, errStr;
CFileDialog dlg(FALSE, _T("po"), NULL,
CFileDialog dlg(FALSE, L"po", NULL,
OFN_OVERWRITEPROMPT|OFN_NOREADONLYRETURN|OFN_HIDEREADONLY,
"Disk Images (*.po)|*.po||", this);
L"Disk Images (*.po)|*.po||", this);
dlg.m_ofn.lpstrTitle = "New Disk Image (.PO)";
dlg.m_ofn.lpstrTitle = L"New Disk Image (.PO)";
dlg.m_ofn.lpstrInitialDir = fPreferences.GetPrefString(kPrOpenArchiveFolder);
if (dlg.DoModal() != IDOK) {
@ -2028,7 +2028,7 @@ MainWindow::OnActionsConvDisk(void)
fPreferences.SetPrefString(kPrOpenArchiveFolder, saveFolder);
filename = dlg.GetPathName();
WMSG1(" Will xfer to file '%s'\n", filename);
WMSG1(" Will xfer to file '%ls'\n", filename);
/* remove file if it already exists */
CString errMsg;
@ -2149,8 +2149,8 @@ MainWindow::OnActionsConvFile(void)
//selSet.Dump();
if (selSet.GetNumEntries() == 0) {
MessageBox("No files matched the selection criteria.",
"No match", MB_OK|MB_ICONEXCLAMATION);
MessageBox(L"No files matched the selection criteria.",
L"No match", MB_OK|MB_ICONEXCLAMATION);
return;
}
@ -2164,11 +2164,11 @@ MainWindow::OnActionsConvFile(void)
*/
CString filename, saveFolder, errStr;
CFileDialog dlg(FALSE, _T("shk"), NULL,
CFileDialog dlg(FALSE, L"shk", NULL,
OFN_OVERWRITEPROMPT|OFN_NOREADONLYRETURN|OFN_HIDEREADONLY,
"ShrinkIt Archives (*.shk)|*.shk||", this);
L"ShrinkIt Archives (*.shk)|*.shk||", this);
dlg.m_ofn.lpstrTitle = "New Archive";
dlg.m_ofn.lpstrTitle = L"New Archive";
dlg.m_ofn.lpstrInitialDir = fPreferences.GetPrefString(kPrOpenArchiveFolder);
if (dlg.DoModal() != IDOK) {
@ -2181,7 +2181,7 @@ MainWindow::OnActionsConvFile(void)
fPreferences.SetPrefString(kPrOpenArchiveFolder, saveFolder);
filename = dlg.GetPathName();
WMSG1(" Will xfer to file '%s'\n", filename);
WMSG1(" Will xfer to file '%ls'\n", filename);
/* remove file if it already exists */
CString errMsg;
@ -2273,9 +2273,9 @@ MainWindow::OnActionsConvFromWav(void)
CassetteDialog dlg;
CString fileName, saveFolder;
CFileDialog fileDlg(TRUE, "wav", NULL, OFN_FILEMUSTEXIST|OFN_HIDEREADONLY,
"Sound Files (*.wav)|*.wav||", this);
fileDlg.m_ofn.lpstrTitle = "Open Sound File";
CFileDialog fileDlg(TRUE, L"wav", NULL, OFN_FILEMUSTEXIST|OFN_HIDEREADONLY,
L"Sound Files (*.wav)|*.wav||", this);
fileDlg.m_ofn.lpstrTitle = L"Open Sound File";
fileDlg.m_ofn.lpstrInitialDir = fPreferences.GetPrefString(kPrOpenWAVFolder);
if (fileDlg.DoModal() != IDOK)
@ -2286,7 +2286,7 @@ MainWindow::OnActionsConvFromWav(void)
fPreferences.SetPrefString(kPrOpenWAVFolder, saveFolder);
fileName = fileDlg.GetPathName();
WMSG1("Opening WAV file '%s'\n", fileName);
WMSG1("Opening WAV file '%ls'\n", fileName);
dlg.fFileName = fileName;
// pass in fpOpenArchive?
@ -2340,7 +2340,7 @@ MainWindow::SaveToArchive(GenericArchive::FileDetails* pDetails,
else
dataBuf = new unsigned char[dataLen];
if (dataBuf == nil) {
errMsg.Format("Unable to allocate %ld bytes", dataLen);
errMsg.Format(L"Unable to allocate %ld bytes", dataLen);
goto bail;
}
memcpy(dataBuf, dataBufIn, dataLen);
@ -2368,7 +2368,7 @@ MainWindow::SaveToArchive(GenericArchive::FileDetails* pDetails,
}
if (pTargetSubdir != nil) {
storagePrefix = pTargetSubdir->GetPathName();
WMSG1("--- using storagePrefix '%s'\n", (const char*) storagePrefix);
WMSG1("--- using storagePrefix '%ls'\n", storagePrefix);
}
if (!storagePrefix.IsEmpty()) {
CString tmpStr, tmpFileName;
@ -2421,9 +2421,9 @@ MainWindow::OnActionsImportBAS(void)
ImportBASDialog dlg;
CString fileName, saveFolder;
CFileDialog fileDlg(TRUE, "txt", NULL, OFN_FILEMUSTEXIST | OFN_HIDEREADONLY,
"Text files (*.txt)|*.txt||", this);
fileDlg.m_ofn.lpstrTitle = "Open Text File";
CFileDialog fileDlg(TRUE, L"txt", NULL, OFN_FILEMUSTEXIST | OFN_HIDEREADONLY,
L"Text files (*.txt)|*.txt||", this);
fileDlg.m_ofn.lpstrTitle = L"Open Text File";
fileDlg.m_ofn.lpstrInitialDir = fPreferences.GetPrefString(kPrAddFileFolder);
if (fileDlg.DoModal() != IDOK)
@ -2434,7 +2434,7 @@ MainWindow::OnActionsImportBAS(void)
fPreferences.SetPrefString(kPrAddFileFolder, saveFolder);
fileName = fileDlg.GetPathName();
WMSG1("Opening TXT file '%s'\n", fileName);
WMSG1("Opening TXT file '%ls'\n", fileName);
dlg.fFileName = fileName;
// pass in fpOpenArchive?
@ -2530,7 +2530,7 @@ MainWindow::GetFilePart(const GenericEntry* pEntry, int whichThread,
if (threadLen > fPreferences.GetPrefLong(kPrMaxViewFileSize)) {
errMsg.Format(
"[File size (%I64d KBytes) exceeds file viewer maximum (%ld KBytes).]\n",
L"[File size (%I64d KBytes) exceeds file viewer maximum (%ld KBytes).]\n",
((LONGLONG) threadLen + 1023) / 1024,
(fPreferences.GetPrefLong(kPrMaxViewFileSize) + 1023) / 1024);
pHolder->SetErrorMsg(part, errMsg);
@ -2546,12 +2546,13 @@ MainWindow::GetFilePart(const GenericEntry* pEntry, int whichThread,
pHolder->SetSourceBuf(part, (unsigned char*) buf, len);
} else if (result == IDCANCEL) {
/* not expected */
errMsg = "Cancelled!";
errMsg = L"Cancelled!";
pHolder->SetErrorMsg(part, errMsg);
ASSERT(buf == nil);
} else {
/* transfer error message to ReformatHolder buffer */
WMSG1("Got error message from ExtractThread: '%s'\n", errMsg);
WMSG1("Got error message from ExtractThread: '%ls'\n",
(LPCWSTR) errMsg);
pHolder->SetErrorMsg(part, errMsg);
ASSERT(buf == nil);
}

View File

@ -6,8 +6,8 @@
/*
* Resolve a filename clash when adding files.
*/
#ifndef __ADDCLASHDIALOG__
#define __ADDCLASHDIALOG__
#ifndef APP_ADDCLASHDIALOG_H
#define APP_ADDCLASHDIALOG_H
/*
*
@ -36,4 +36,4 @@ private:
DECLARE_MESSAGE_MAP()
};
#endif /*__ADDCLASHDIALOG__*/
#endif /*APP_ADDCLASHDIALOG_H*/

View File

@ -125,7 +125,7 @@ AddFilesDialog::ValidateStoragePrefix(void)
const char kFssep = PathProposal::kDefaultStoredFssep;
if (fStoragePrefix[0] == kFssep || fStoragePrefix.Right(1) == kFssep) {
CString errMsg;
errMsg.Format("The storage prefix may not start or end with '%c'.",
errMsg.Format(L"The storage prefix may not start or end with '%c'.",
kFssep);
MessageBox(errMsg, m_ofn.lpstrTitle, MB_OK | MB_ICONWARNING);
return false;

View File

@ -7,8 +7,8 @@
* File selection dialog, a sub-class of "Open" that allows multiple selection
* of both files and directories.
*/
#ifndef __ADDFILESDIALOG__
#define __ADDFILESDIALOG__
#ifndef APP_ADDFILESDIALOG_H
#define APP_ADDFILESDIALOG_H
#include "../diskimg/DiskImg.h"
#include "../util/UtilLib.h"
@ -23,9 +23,9 @@
class AddFilesDialog : public SelectFilesDialog {
public:
AddFilesDialog(CWnd* pParentWnd = NULL) :
SelectFilesDialog("IDD_ADD_FILES", pParentWnd)
SelectFilesDialog(L"IDD_ADD_FILES", pParentWnd)
{
SetWindowTitle(_T("Add Files..."));
SetWindowTitle(L"Add Files...");
fStoragePrefix = "";
fStoragePrefixEnable = true;
fIncludeSubfolders = FALSE;
@ -77,4 +77,4 @@ private:
//DECLARE_MESSAGE_MAP()
};
#endif /*__ADDFILESDIALOG__*/
#endif /*APP_ADDFILESDIALOG_H*/

View File

@ -9,7 +9,7 @@
#include "StdAfx.h"
#include "HelpTopics.h"
#include "ArchiveInfoDialog.h"
#include "../prebuilt/NufxLib.h"
#include "../nufxlib/NufxLib.h"
/*
* ===========================================================================
@ -60,12 +60,13 @@ NufxArchiveInfoDialog::OnInitDialog(void)
ASSERT(pMasterHeader != nil);
pWnd = GetDlgItem(IDC_AI_FILENAME);
pWnd->SetWindowText(fpArchive->GetPathName());
CString pathName(fpArchive->GetPathName());
pWnd->SetWindowText(pathName);