Crypt Library Demo 1.00
|
00001 /* This file is part of Crypt Library Demo application developed by Mihai MOGA. 00002 00003 Image Converter is free software: you can redistribute it and/or modify it 00004 under the terms of the GNU General Public License as published by the Open 00005 Source Initiative, either version 3 of the License, or any later version. 00006 00007 Image Converter is distributed in the hope that it will be useful, but 00008 WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY 00009 or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. 00010 00011 You should have received a copy of the GNU General Public License along with 00012 Crypt Library Demo. If not, see <http://www.opensource.org/licenses/gpl-3.0.html>*/ 00013 00014 // CryptLibraryDemo.cpp : Defines the class behaviors for the application. 00015 // 00016 00017 #include "stdafx.h" 00018 #include "CryptLibraryDemo.h" 00019 #include "CryptLibraryDemoDlg.h" 00020 00021 #ifdef _DEBUG 00022 #define new DEBUG_NEW 00023 #endif 00024 00026 // CCryptLibraryDemoApp 00028 00029 BEGIN_MESSAGE_MAP(CCryptLibraryDemoApp, CWinAppEx) 00030 ON_COMMAND(ID_HELP, &CWinApp::OnHelp) 00031 END_MESSAGE_MAP() 00032 00034 // CCryptLibraryDemoApp construction 00036 00037 CCryptLibraryDemoApp::CCryptLibraryDemoApp() 00038 { 00039 EnableHtmlHelp(); 00040 00041 // TODO: add construction code here, 00042 // Place all significant initialization in InitInstance 00043 } 00044 00045 00046 // The one and only CCryptLibraryDemoApp object 00047 00048 CCryptLibraryDemoApp theApp; 00049 00051 // CCryptLibraryDemoApp initialization 00053 00054 BOOL CCryptLibraryDemoApp::InitInstance() 00055 { 00056 // InitCommonControlsEx() is required on Windows XP if an application 00057 // manifest specifies use of ComCtl32.dll version 6 or later to enable 00058 // visual styles. Otherwise, any window creation will fail. 00059 INITCOMMONCONTROLSEX InitCtrls; 00060 InitCtrls.dwSize = sizeof(InitCtrls); 00061 // Set this to include all the common control classes you want to use 00062 // in your application. 00063 InitCtrls.dwICC = ICC_WIN95_CLASSES; 00064 InitCommonControlsEx(&InitCtrls); 00065 00066 CWinAppEx::InitInstance(); 00067 00068 AfxEnableControlContainer(); 00069 00070 // Standard initialization 00071 // If you are not using these features and wish to reduce the size 00072 // of your final executable, you should remove from the following 00073 // the specific initialization routines you do not need 00074 // Change the registry key under which our settings are stored 00075 // TODO: You should modify this string to be something appropriate 00076 // such as the name of your company or organization 00077 SetRegistryKey(_T("MihaiMoga")); 00078 00079 delete AfxGetApp()->m_pszExeName; 00080 AfxGetApp()->m_pszExeName = new TCHAR[_MAX_PATH]; 00081 00082 delete AfxGetApp()->m_pszProfileName; 00083 AfxGetApp()->m_pszProfileName = new TCHAR[_MAX_PATH]; 00084 00085 TCHAR lpszDrive[_MAX_DRIVE]; 00086 TCHAR lpszDirectory[_MAX_DIR]; 00087 TCHAR lpszFilename[_MAX_FNAME]; 00088 TCHAR lpszExtension[_MAX_EXT]; 00089 00090 LPTSTR lpszHelpPath = (LPTSTR) AfxGetApp()->m_pszHelpFilePath; 00091 LPTSTR lpszExePath = (LPTSTR) AfxGetApp()->m_pszExeName; 00092 LPTSTR lpszIniPath = (LPTSTR) AfxGetApp()->m_pszProfileName; 00093 00094 VERIFY(0 == _tsplitpath_s(lpszHelpPath, lpszDrive, _MAX_DRIVE, lpszDirectory, _MAX_DIR, lpszFilename, _MAX_FNAME, lpszExtension, _MAX_EXT)); 00095 VERIFY(0 == _tmakepath_s(lpszExePath, _MAX_PATH, lpszDrive, lpszDirectory, lpszFilename, _T(".exe"))); 00096 VERIFY(0 == _tmakepath_s(lpszIniPath, _MAX_PATH, lpszDrive, lpszDirectory, lpszFilename, _T(".ini"))); 00097 00098 CCryptLibraryDemoDlg dlgCryptLibraryDemo; 00099 m_pMainWnd = &dlgCryptLibraryDemo; 00100 INT_PTR nResponse = dlgCryptLibraryDemo.DoModal(); 00101 if (nResponse == IDOK) 00102 { 00103 // TODO: Place code here to handle when the dialog is 00104 // dismissed with OK 00105 } 00106 else if (nResponse == IDCANCEL) 00107 { 00108 // TODO: Place code here to handle when the dialog is 00109 // dismissed with Cancel 00110 } 00111 00112 // Since the dialog has been closed, return FALSE so that we exit the 00113 // application, rather than start the application's message pump. 00114 return FALSE; 00115 }