mirror of
https://github.com/reactos/reactos.git
synced 2025-08-05 22:52:54 +00:00
[MSPAINT_NEW]
Fix build on MSVC by rewriting the code in *STANDARD* C++ !! (and not into some strange idiom called "GCC-C++"). I suggest also to write a proper class for dynamically-allocated (resource) strings instead of either having the static arrays of hardcoded sizes, or being tempted to use non-standard constructs as the one I just saw. (and btw, instead of defining a new "SIZEOF()" macro, there is one which already exists in the PSDK called "ARRAYSIZE()" which just does the correct job). svn path=/trunk/; revision=68587
This commit is contained in:
parent
2d44138c21
commit
5c15cde76e
1 changed files with 5 additions and 8 deletions
|
@ -196,14 +196,11 @@ LRESULT CMainWindow::OnClose(UINT nMsg, WPARAM wParam, LPARAM lParam, BOOL& bHan
|
||||||
{
|
{
|
||||||
if (!imageModel.IsImageSaved())
|
if (!imageModel.IsImageSaved())
|
||||||
{
|
{
|
||||||
TCHAR* tempptr;
|
TCHAR programname[20];
|
||||||
TCHAR programname[LoadString(hProgInstance, IDS_PROGRAMNAME, (LPTSTR)&tempptr, 0) + 1];
|
TCHAR saveprompttext[100];
|
||||||
CopyMemory(programname, tempptr, sizeof(programname) - sizeof(TCHAR));
|
TCHAR temptext[500];
|
||||||
programname[SIZEOF(programname) - 1] = (TCHAR)'\0';
|
LoadString(hProgInstance, IDS_PROGRAMNAME, programname, SIZEOF(programname));
|
||||||
TCHAR saveprompttext[LoadString(hProgInstance, IDS_SAVEPROMPTTEXT, (LPTSTR)&tempptr, 0) + 1];
|
LoadString(hProgInstance, IDS_SAVEPROMPTTEXT, saveprompttext, SIZEOF(saveprompttext));
|
||||||
CopyMemory(saveprompttext, tempptr, sizeof(saveprompttext) - sizeof(TCHAR));
|
|
||||||
saveprompttext[SIZEOF(saveprompttext) - 1] = (TCHAR)'\0';
|
|
||||||
TCHAR temptext[SIZEOF(saveprompttext) + _tcslen(filename)];
|
|
||||||
_stprintf(temptext, saveprompttext, filename);
|
_stprintf(temptext, saveprompttext, filename);
|
||||||
switch (MessageBox(temptext, programname, MB_YESNOCANCEL | MB_ICONQUESTION))
|
switch (MessageBox(temptext, programname, MB_YESNOCANCEL | MB_ICONQUESTION))
|
||||||
{
|
{
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue