From 810488e20c801b8f306966b2143abe7601617425 Mon Sep 17 00:00:00 2001 From: andreja6 Date: Fri, 20 Apr 2018 06:59:37 -0700 Subject: [PATCH] Added test dialog --- Work.cpp | 1 - main.cpp | 9 +++++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/Work.cpp b/Work.cpp index 9666bc9..57d3b35 100644 --- a/Work.cpp +++ b/Work.cpp @@ -4,7 +4,6 @@ #include "stdafx.h" #include "Work.h" - // Work dialog IMPLEMENT_DYNAMIC(Work, CDialog) diff --git a/main.cpp b/main.cpp index 8ed0ec0..70c8c5a 100644 --- a/main.cpp +++ b/main.cpp @@ -14,6 +14,7 @@ #define WINVER 0x0400 #include #include "Instance.h" +#include "resource.h" #include "PhysicalInstance.h" #include "TextButtonInstance.h" @@ -348,7 +349,7 @@ void OnError(int err, std::string msg = "") std::string emsg = "An unexpected error has occured and DUOM 5 has to quit. We're sorry!" + msg; clearInstances(); //DialogBox(NULL, MAKEINTRESOURCE(IDD_DIALOG1), NULL, NULL); - MessageBoxA(NULL, emsg.c_str(),"Dynamica Crash", MB_OK); + MessageBox(NULL, emsg.c_str(),"Dynamica Crash", MB_OK); exit(err); } @@ -452,6 +453,10 @@ void Demo::onUserInput(UserInput* ui) { message = "FPS has been set to " + Convert(FPSVal[index]); setDesiredFrameRate(FPSVal[index]); } + if(ui->keyPressed('u')) + { + DialogBox(NULL, MAKEINTRESOURCE(IDD_ABOUT_DIALOG), NULL, NULL); + } mousex = ui->getMouseX(); mousey = ui->getMouseY(); mouseButton1Down = ui->keyDown(SDL_LEFT_MOUSE_KEY); @@ -463,7 +468,7 @@ void Demo::onUserInput(UserInput* ui) { std::string ExePath() { char buffer[MAX_PATH]; - GetModuleFileNameA( NULL, buffer, MAX_PATH ); + GetModuleFileName( NULL, buffer, MAX_PATH ); std::string::size_type pos = std::string( buffer ).find_last_of( "\\/" ); return std::string( buffer ).substr( 0, pos); }