home *** CD-ROM | disk | FTP | other *** search
/ Tricks of the Windows Gam…ming Gurus (2nd Edition) / Disc2.iso / msdn_vcb / samples / vc98 / mfc / controls / image / image.cpp < prev    next >
Encoding:
C/C++ Source or Header  |  1998-03-27  |  2.2 KB  |  82 lines

  1. // image.cpp : Implementation of CImageApp and DLL registration.
  2. //
  3. // This is a part of the Microsoft Foundation Classes C++ library.
  4. // Copyright (C) 1992-1998 Microsoft Corporation
  5. // All rights reserved.
  6. //
  7. // This source code is only intended as a supplement to the
  8. // Microsoft Foundation Classes Reference and related
  9. // electronic documentation provided with the library.
  10. // See these sources for detailed information regarding the
  11. // Microsoft Foundation Classes product.
  12.  
  13. #include "stdafx.h"
  14. #include "image.h"
  15.  
  16. #ifdef _DEBUG
  17. #define new DEBUG_NEW
  18. #undef THIS_FILE
  19. static char THIS_FILE[] = __FILE__;
  20. #endif
  21.  
  22.  
  23. CImageApp NEAR theApp;
  24.  
  25. const GUID CDECL BASED_CODE _tlid =
  26.         { 0x346685e0, 0xc383, 0x11cf, { 0xa5, 0xa4, 0, 0xaa, 0, 0xa4, 0x57, 0x5 } };
  27. const WORD _wVerMajor = 1;
  28. const WORD _wVerMinor = 0;
  29.  
  30.  
  31. ////////////////////////////////////////////////////////////////////////////
  32. // CImageApp::InitInstance - DLL initialization
  33.  
  34. BOOL CImageApp::InitInstance()
  35. {
  36.     BOOL bInit = COleControlModule::InitInstance();
  37.     return bInit;
  38. }
  39.  
  40.  
  41. ////////////////////////////////////////////////////////////////////////////
  42. // CImageApp::ExitInstance - DLL termination
  43.  
  44. int CImageApp::ExitInstance()
  45. {
  46.     return COleControlModule::ExitInstance();
  47. }
  48.  
  49.  
  50. /////////////////////////////////////////////////////////////////////////////
  51. // DllRegisterServer - Adds entries to the system registry
  52.  
  53. STDAPI DllRegisterServer(void)
  54. {
  55.     AFX_MANAGE_STATE(_afxModuleAddrThis);
  56.  
  57.     if (!AfxOleRegisterTypeLib(AfxGetInstanceHandle(), _tlid))
  58.         return ResultFromScode(SELFREG_E_TYPELIB);
  59.  
  60.     if (!COleObjectFactoryEx::UpdateRegistryAll(TRUE))
  61.         return ResultFromScode(SELFREG_E_CLASS);
  62.  
  63.     return NOERROR;
  64. }
  65.  
  66.  
  67. /////////////////////////////////////////////////////////////////////////////
  68. // DllUnregisterServer - Removes entries from the system registry
  69.  
  70. STDAPI DllUnregisterServer(void)
  71. {
  72.     AFX_MANAGE_STATE(_afxModuleAddrThis);
  73.  
  74.     if (!AfxOleUnregisterTypeLib(_tlid, _wVerMajor, _wVerMinor))
  75.         return ResultFromScode(SELFREG_E_TYPELIB);
  76.  
  77.     if (!COleObjectFactoryEx::UpdateRegistryAll(FALSE))
  78.         return ResultFromScode(SELFREG_E_CLASS);
  79.  
  80.     return NOERROR;
  81. }
  82.