From df04d6a0f50b2d93645f97a1811b7863f2322b3f Mon Sep 17 00:00:00 2001 From: Dario Sassi Date: Fri, 1 Mar 2019 15:26:04 +0000 Subject: [PATCH] KeyGenerator 2.1c3 : - aggiunta restituzione codice di errore (0=ok, 1=errore) dall'eseguibile. --- KeyGenerator.cpp | 17 ++++++++++++++--- KeyGenerator.h | 6 +++++- KeyGenerator.rc | Bin 28448 -> 28448 bytes 3 files changed, 19 insertions(+), 4 deletions(-) diff --git a/KeyGenerator.cpp b/KeyGenerator.cpp index 91b6af3..5ab87c1 100644 --- a/KeyGenerator.cpp +++ b/KeyGenerator.cpp @@ -56,9 +56,9 @@ CKeyGeneratorApp::InitInstance( void) { // CommonControls initialize INITCOMMONCONTROLSEX InitCtrls ; - InitCtrls.dwSize = sizeof(InitCtrls) ; + InitCtrls.dwSize = sizeof( InitCtrls) ; InitCtrls.dwICC = ICC_WIN95_CLASSES ; - InitCommonControlsEx(&InitCtrls) ; + InitCommonControlsEx( &InitCtrls) ; CWinApp::InitInstance() ; @@ -85,8 +85,10 @@ CKeyGeneratorApp::InitInstance( void) // verifico la protezione SetLockType( KEY_LOCK_TYPE_HW) ; string sKey = GetPrivateProfileStringUtf8( "General", "Key", "", m_pszProfileName) ; - if ( VerifyKey( sKey, 823, 16, 10) != KEY_OK) + if ( VerifyKey( sKey, 823, 16, 10) != KEY_OK) { + m_nExitCode = 1 ; return FALSE ; + } // gestione linea di comando int nFlag = 0 ; @@ -102,9 +104,18 @@ CKeyGeneratorApp::InitInstance( void) dlg.DoModal() ; // Per uscire dall'applicazione + m_nExitCode = 0 ; return FALSE ; } +//---------------------------------------------------------------------------- +int +CKeyGeneratorApp::ExitInstance( void) +{ + CWinApp::ExitInstance() ; + return m_nExitCode ; +} + //---------------------------------------------------------------------------- string GetExeNameVer( void) diff --git a/KeyGenerator.h b/KeyGenerator.h index 3602c9d..95c5739 100644 --- a/KeyGenerator.h +++ b/KeyGenerator.h @@ -27,9 +27,13 @@ class CKeyGeneratorApp : public CWinApp CKeyGeneratorApp( void) ; public : - virtual BOOL InitInstance( void) ; + BOOL InitInstance( void) override ; + int ExitInstance( void) override ; DECLARE_MESSAGE_MAP() + + private : + int m_nExitCode ; } ; //---------------------------------------------------------------------------- diff --git a/KeyGenerator.rc b/KeyGenerator.rc index 80da1518afa6cdc22a046003682841cdd62e7922..df972df4c7404afbc1e5ea3e99a4b9b907f69292 100644 GIT binary patch delta 66 zcmZ2*k8#00#tj^%ti}vF42GL|O|6-klNk&r^E>Enp5TzcxcP>q4l`WxHPhrT_Bluj HCg=eGiZc_z delta 66 zcmZ2*k8#00#tj^%tVRqv491&zO|6-klNgLA^E>Enp5TzcxcP>q4l`WxHPhrT_Bluj HCg=eGil-CB