/***********************************************************************/ /* Copyright (C) 2002 Definitive Solutions, Inc. All Rights Reserved. */ /* THIS COMPUTER PROGRAM IS PROPRIETARY AND CONFIDENTIAL TO DEFINITIVE */ /* SOLUTIONS, INC. AND ITS LICENSORS AND CONTAINS TRADE SECRETS OF */ /* DEFINITIVE SOLUTIONS, INC. THAT ARE PROVIDED PURSUANT TO A WRITTEN */ /* AGREEMENT CONTAINING RESTRICTIONS ON USE AND DISCLOSURE. ANY USE, */ /* REPRODUCTION, OR TRANSFER EXCEPT AS PROVIDED IN SUCH AGREEMENT */ /* IS STRICTLY PROHIBITED. */ /***********************************************************************/ ///////////////////////////////////////////////////////////////////////////// // How to add this class to your application. // // Change all occurances of CWinApp to MyApp in your application. (Be careful // not to modify the MyApp.* files themselves!). // // In your app's header file, add this: // // #include "MyApp.h" // ///////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////// // Map of resource ids // // To avoid using the same resource ids as the "My" classes do, applications // should not uses these ranges. Here is a list of the ranges in use: // // MyLog - 10000's // MyModelessDlg - 11000's // MyRichEditCtrl - 12000's // MyListCtrl - 13000's // MyEdit - 14000's // MyHyperlink - 15000's // MyFileDeleteDlg - 16000's // MyTipDlg - 17000's // MyButton - 18000's // MyMessageBox - 19000's // ///////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////// /* From "Technical Note # 33": Limitations of _AFXEXT You can use the _AFXEXT pre-processor symbol for your extension DLLs as long as you do not have multiple layers of extension DLLs. If you have extension DLLs which call or derive from classes in your own extension DLLs, which then derive from the MFC classes, you must use your own preprocessor symbol to avoid ambiguity. The problem is that in Win32, you must explicitly declare any data as __declspec(dllexport) if it is to be exported from a DLL, and __declspec(dllimport) if it is to be imported from a DLL. When you define _AFXEXT, the MFC headers make sure that AFX_EXT_CLASS is defined correctly. When you have multiple layers, one symbol such as AFX_EXT_CLASS is not sufficient, since an extension DLL may be exporting new classes as well as importing other classes from another extension DLL. In order to deal with this problem, use a special pre-processor symbol which indicates that you are building the DLL itself versus using the DLL. */ ///////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////// // If MyApp.cpp is in a DLL project, then from the MSVC "Project | Settings" // menu item, select the "C/C++" tab, then the "Preprocessor" category, and // add MYAPPCPP_IS_IN_A_DLL_PROJECT_ to the "Preprocessor Definitions" edit // control. ///////////////////////////////////////////////////////////////////////////// #if !defined(AFX_MYAPP_H__109A7851_8C0B_11D5_8A2B_00B0D0529ED2__INCLUDED_) #define AFX_MYAPP_H__109A7851_8C0B_11D5_8A2B_00B0D0529ED2__INCLUDED_ #pragma once #include "MyLog.h" ///////////////////////////////////////////////////////////////////////////// // MyApp class // This is where we select the appropriate linkage specification. This allows // this class to be used either in a DLL project or an EXE project, too. #ifdef MYAPPCPP_IS_IN_A_DLL_PROJECT_ #ifdef MYAPPCPP_BUILDING_ __declspec (dllexport) #else #ifndef _WINDLL __declspec (dllimport) #endif #endif #endif MyApp : public CWinApp { // Construction. public: MyApp(const CString& sLogFileName); MyApp(); virtual ~MyApp(); DECLARE_DYNCREATE(MyApp) // Operations. public: // Derived classes must implement this! virtual CString GetCompanyName() const; bool GetToolTipSoundEnabled() const; void SetToolTipSoundEnabled(bool b); //{{AFX_VIRTUAL(MyApp) public: virtual BOOL InitInstance(); virtual int ExitInstance(); //}}AFX_VIRTUAL // Implementation. protected: //{{AFX_MSG(MyApp) //}}AFX_MSG DECLARE_MESSAGE_MAP() // Public data. public: MyLog TheLog; // Expected by the MyLog class. bool m_bIsToolTipSoundEnabled; // Is it on? }; //{{AFX_INSERT_LOCATION}} // Microsoft Visual C++ will insert additional declarations immediately before the previous line. #endif // !defined(AFX_MYAPP_H__109A7851_8C0B_11D5_8A2B_00B0D0529ED2__INCLUDED_)