Discovered that modifying the wxWidgets manifest has no effect

Restored the wallet manifest.
Discovered that local wxString variables are apt to get wiped during
a throw.  Dangerous to pass a wXstring.utf8() to an exception
This commit is contained in:
Cheng 2023-09-25 10:23:11 +10:00
parent 883bd8ebe8
commit fefb99bb33
No known key found for this signature in database
GPG Key ID: 571C3A9C3B9E6FCA
3 changed files with 15 additions and 12 deletions

View File

@ -80,13 +80,14 @@
<AdditionalDependencies>mpir.lib;mpirxx.lib;libsodium.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
<Manifest>
<AdditionalManifestFiles>wallet.manifest %(AdditionalManifestFiles)</AdditionalManifestFiles>
<AdditionalManifestFiles>
</AdditionalManifestFiles>
</Manifest>
<Manifest>
<GenerateCategoryTags>false</GenerateCategoryTags>
<GenerateCategoryTags>true</GenerateCategoryTags>
</Manifest>
<Manifest>
<EnableDpiAwareness>PerMonitorHighDPIAware</EnableDpiAwareness>
<EnableDpiAwareness>false</EnableDpiAwareness>
</Manifest>
<ResourceCompile />
<CustomBuildStep />
@ -123,6 +124,9 @@
<CustomBuildStep />
<CustomBuildStep />
<CustomBuildStep />
<Manifest>
<GenerateCategoryTags>true</GenerateCategoryTags>
</Manifest>
</ItemDefinitionGroup>
<ItemGroup>
<ClInclude Include="../src/app.h" />

View File

@ -25,7 +25,7 @@ void sqlite3_init() {
errorCode = 7;
szError = "Fatal Error: Sqlite library did not init.";
// Cannot log the error, because logging not set up yet, so logging itself causes an exception
throw FatalException(szError.c_str());
throw FatalException(szError);
}
}

View File

@ -264,27 +264,26 @@ static bool checkDataConversionsProduceExpected(void){
}
static bool CheckForUtfEnvironment(void) {
ILogMessage("\tChecking for UTF locale.");
ILogMessage("\tChecking for UTF locale.");
try {
bool utfEnvironment{ true };
wxString utfError{ wxT("") };
if constexpr (b_WINDOWS) {
auto ACP{ GetACP() };
// Check that windows thinks this is UTF8
utfEnvironment = utfEnvironment && (ACP == 65001);
if (!utfEnvironment) {
utfError += wxString::Format(wxT("current code page %d—should be 65001☹, "), ACP);
szError = std::format("current code page {}, —should be 65001☹, ", ACP);
}
}
auto FontEncoding{ wxLocale::GetSystemEncoding() };
// check that wxWidgets thinks this is UTF8
utfEnvironment = utfEnvironment && (FontEncoding == wxFONTENCODING_UTF8);
if (!utfEnvironment) {
utfError = wxString::Format(wxT("%swxFontEncoding %d—should be %d☹"),
utfError,
FontEncoding,
wxFONTENCODING_UTF8);
throw MyException(utfError.c_str(), __LINE__, __func__, SrcFilename);
szError += std::format("swxFontEncoding {}, should be {} ☹",
(int)FontEncoding,
(int)wxFONTENCODING_UTF8
);
throw MyException(szError, __LINE__, __func__, SrcFilename);
}
}
catch (const MyException& e) {