home *** CD-ROM | disk | FTP | other *** search
/ Troubleshooting Netware Systems / CSTRIAL0196.BIN / attach / msj / v10n10 / vb40.exe / SHELLOCX.EXE / SHELLINK.CPP < prev    next >
C/C++ Source or Header  |  1995-10-01  |  2KB  |  79 lines

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