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

  1. // DrawPic.cpp : Implementation of CDrawPicApp 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 "DrawPic.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. CDrawPicApp NEAR theApp;
  24.  
  25. const GUID CDECL BASED_CODE _tlid =
  26.         { 0x57f5a420, 0xa324, 0x11cf, { 0xb4, 0xa4, 0x44, 0x45, 0x53, 0x54, 0, 0 } };
  27. const WORD _wVerMajor = 1;
  28. const WORD _wVerMinor = 0;
  29.  
  30.  
  31. ////////////////////////////////////////////////////////////////////////////
  32. // CDrawPicApp::InitInstance - DLL initialization
  33.  
  34. BOOL CDrawPicApp::InitInstance()
  35. {
  36.     BOOL bInit = COleControlModule::InitInstance();
  37.  
  38.     if (bInit)
  39.     {
  40.         // TODO: Add your own module initialization code here.
  41.     }
  42.  
  43.     return bInit;
  44. }
  45.  
  46.  
  47. ////////////////////////////////////////////////////////////////////////////
  48. // CDrawPicApp::ExitInstance - DLL termination
  49.  
  50. int CDrawPicApp::ExitInstance()
  51. {
  52.     // TODO: Add your own module termination code here.
  53.  
  54.     return COleControlModule::ExitInstance();
  55. }
  56.  
  57.  
  58. /////////////////////////////////////////////////////////////////////////////
  59. // DllRegisterServer - Adds entries to the system registry
  60.  
  61. STDAPI DllRegisterServer(void)
  62. {
  63.     AFX_MANAGE_STATE(_afxModuleAddrThis);
  64.  
  65.     if (!AfxOleRegisterTypeLib(AfxGetInstanceHandle(), _tlid))
  66.         return ResultFromScode(SELFREG_E_TYPELIB);
  67.  
  68.     if (!COleObjectFactoryEx::UpdateRegistryAll(TRUE))
  69.         return ResultFromScode(SELFREG_E_CLASS);
  70.  
  71.     return NOERROR;
  72. }
  73.  
  74.  
  75. /////////////////////////////////////////////////////////////////////////////
  76. // DllUnregisterServer - Removes entries from the system registry
  77.  
  78. STDAPI DllUnregisterServer(void)
  79. {
  80.     AFX_MANAGE_STATE(_afxModuleAddrThis);
  81.  
  82.     if (!AfxOleUnregisterTypeLib(_tlid))
  83.         return ResultFromScode(SELFREG_E_TYPELIB);
  84.  
  85.     if (!COleObjectFactoryEx::UpdateRegistryAll(FALSE))
  86.         return ResultFromScode(SELFREG_E_CLASS);
  87.  
  88.     return NOERROR;
  89. }
  90.