home *** CD-ROM | disk | FTP | other *** search
/ Building OCXs / Building_OCXs_Que_1995.iso / code / ch04 / quote.cpp < prev    next >
Encoding:
C/C++ Source or Header  |  1994-12-04  |  2.4 KB  |  88 lines

  1. //------------------------------------------------------------------//
  2. // Implementation of CQuoteApp and DLL registration                    //
  3. //                                                                    //
  4. // System:    Simple first control.                                   //
  5. //            Developing Applications with OCX                        //
  6. // Module:    CQuoteApp class implementation                            //
  7. // Date:    1/11/1994                                                //
  8. // Rev:        1.0                                                           //
  9. //                                                                       //
  10. // Author:    John Toohey                                                   //
  11. //                                                                       //
  12. //------------------------------------------------------------------//
  13.  
  14.  
  15. #include "stdafx.h"
  16. #include "quote.h"
  17.  
  18. #ifdef _DEBUG
  19. #undef THIS_FILE
  20. static char BASED_CODE THIS_FILE[] = __FILE__;
  21. #endif
  22.  
  23.  
  24. CQuoteApp NEAR theApp;
  25.  
  26. const GUID CDECL BASED_CODE _tlid =
  27.         { 0x7c647083, 0xf1cb, 0x101b, { 0x81, 0xec, 0xb2, 0x31, 0x69, 0x42, 0x46, 0x30 } };
  28. const WORD _wVerMajor = 1;
  29. const WORD _wVerMinor = 0;
  30.  
  31. ////////////////////////////////////////////////////////////////////////////
  32. // CQuoteApp::InitInstance - DLL initialization
  33. //
  34. BOOL CQuoteApp::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. // CQuoteApp::ExitInstance - DLL termination
  49.  
  50. int CQuoteApp::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. STDAPI DllUnregisterServer(void)
  75. {
  76.     AFX_MANAGE_STATE(_afxModuleAddrThis);
  77.  
  78.     if (!AfxOleUnregisterTypeLib(_tlid))
  79.         return ResultFromScode(SELFREG_E_TYPELIB);
  80.  
  81.     if (!COleObjectFactoryEx::UpdateRegistryAll(FALSE))
  82.         return ResultFromScode(SELFREG_E_CLASS);
  83.  
  84.     return NOERROR;
  85. }
  86. //--------------------------------------------------------------------------
  87. //--------------------------------------------------------------------------
  88.