home *** CD-ROM | disk | FTP | other *** search
/ Using Visual C++ 4 (Special Edition) / Using_Visual_C_4_Special_Edition_QUE_1996.iso / ch11 / calen.cpp < prev    next >
C/C++ Source or Header  |  1995-10-23  |  2KB  |  80 lines

  1. // Calen.cpp : Implementation of CCalenApp and DLL registration.
  2.  
  3. #include "stdafx.h"
  4. #include "Calen.h"
  5.  
  6. #ifdef _DEBUG
  7. #define new DEBUG_NEW
  8. #undef THIS_FILE
  9. static char THIS_FILE[] = __FILE__;
  10. #endif
  11.  
  12.  
  13. CCalenApp NEAR theApp;
  14.  
  15. const GUID CDECL BASED_CODE _tlid =
  16.         { 0xf0464dd0, 0xd57, 0x11cf, { 0xb4, 0xcd, 0, 0x80, 0xc8, 0x1a, 0x39, 0x7c } };
  17. const WORD _wVerMajor = 1;
  18. const WORD _wVerMinor = 0;
  19.  
  20.  
  21. ////////////////////////////////////////////////////////////////////////////
  22. // CCalenApp::InitInstance - DLL initialization
  23.  
  24. BOOL CCalenApp::InitInstance()
  25. {
  26.     BOOL bInit = COleControlModule::InitInstance();
  27.  
  28.     if (bInit)
  29.     {
  30.         // TODO: Add your own module initialization code here.
  31.     }
  32.  
  33.     return bInit;
  34. }
  35.  
  36.  
  37. ////////////////////////////////////////////////////////////////////////////
  38. // CCalenApp::ExitInstance - DLL termination
  39.  
  40. int CCalenApp::ExitInstance()
  41. {
  42.     // TODO: Add your own module termination code here.
  43.  
  44.     return COleControlModule::ExitInstance();
  45. }
  46.  
  47.  
  48. /////////////////////////////////////////////////////////////////////////////
  49. // DllRegisterServer - Adds entries to the system registry
  50.  
  51. STDAPI DllRegisterServer(void)
  52. {
  53.     AFX_MANAGE_STATE(_afxModuleAddrThis);
  54.  
  55.     if (!AfxOleRegisterTypeLib(AfxGetInstanceHandle(), _tlid))
  56.         return ResultFromScode(SELFREG_E_TYPELIB);
  57.  
  58.     if (!COleObjectFactoryEx::UpdateRegistryAll(TRUE))
  59.         return ResultFromScode(SELFREG_E_CLASS);
  60.  
  61.     return NOERROR;
  62. }
  63.  
  64.  
  65. /////////////////////////////////////////////////////////////////////////////
  66. // DllUnregisterServer - Removes entries from the system registry
  67.  
  68. STDAPI DllUnregisterServer(void)
  69. {
  70.     AFX_MANAGE_STATE(_afxModuleAddrThis);
  71.  
  72.     if (!AfxOleUnregisterTypeLib(_tlid))
  73.         return ResultFromScode(SELFREG_E_TYPELIB);
  74.  
  75.     if (!COleObjectFactoryEx::UpdateRegistryAll(FALSE))
  76.         return ResultFromScode(SELFREG_E_CLASS);
  77.  
  78.     return NOERROR;
  79. }
  80.