home *** CD-ROM | disk | FTP | other *** search
/ Personal Computer World 2002 March / PCWMAR02.iso / software / turbocad / v8trial / TurboCADv8ProfessionalNoReg.exe / Data.Cab / F37588_InsTool.cpp < prev    next >
Encoding:
C/C++ Source or Header  |  2001-10-16  |  2.5 KB  |  87 lines

  1. /******************************************************************/
  2. /*                                                                */
  3. /*                      TurboCAD for Windows                      */
  4. /*                   Copyright (c) 1993 - 2001                    */
  5. /*             International Microcomputer Software, Inc.         */
  6. /*                            (IMSI)                              */
  7. /*                      All rights reserved.                      */
  8. /*                                                                */
  9. /******************************************************************/
  10.  
  11. // InsTool.cpp : Implementation of DLL Exports.
  12.  
  13.  
  14. // Note: Proxy/Stub Information
  15. //        To build a separate proxy/stub DLL, 
  16. //        run nmake -f InsToolps.mk in the project directory.
  17.  
  18. #include "stdafx.h"
  19. #include "resource.h"
  20. #include "initguid.h"
  21. #include "InsTool.h"
  22.  
  23. #include "InsTool_i.c"
  24. #include "InsSymb.h"
  25.  
  26. COleVariant varMissing((long)DISP_E_PARAMNOTFOUND, VT_ERROR);
  27. COleVariant varTrue(1L);
  28. COleVariant varFalse(0L);
  29.  
  30. CComModule _Module;
  31.  
  32. BEGIN_OBJECT_MAP(ObjectMap)
  33.     OBJECT_ENTRY(CLSID_InsSymb, CInsSymb)
  34. END_OBJECT_MAP()
  35.  
  36.  
  37. CInsToolApp theApp;
  38.  
  39. BOOL CInsToolApp::InitInstance()
  40. {
  41.     _Module.Init(ObjectMap, m_hInstance);
  42.     return CWinApp::InitInstance();
  43. }
  44.  
  45. int CInsToolApp::ExitInstance()
  46. {
  47.     _Module.Term();
  48.     return CWinApp::ExitInstance();
  49. }
  50.  
  51. /////////////////////////////////////////////////////////////////////////////
  52. // Used to determine whether the DLL can be unloaded by OLE
  53.  
  54. STDAPI DllCanUnloadNow(void)
  55. {
  56.     AFX_MANAGE_STATE(AfxGetStaticModuleState());
  57.     return (AfxDllCanUnloadNow()==S_OK && _Module.GetLockCount()==0) ? S_OK : S_FALSE;
  58. }
  59.  
  60. /////////////////////////////////////////////////////////////////////////////
  61. // Returns a class factory to create an object of the requested type
  62.  
  63. STDAPI DllGetClassObject(REFCLSID rclsid, REFIID riid, LPVOID* ppv)
  64. {
  65.     return _Module.GetClassObject(rclsid, riid, ppv);
  66. }
  67.  
  68. /////////////////////////////////////////////////////////////////////////////
  69. // DllRegisterServer - Adds entries to the system registry
  70.  
  71. STDAPI DllRegisterServer(void)
  72. {
  73.     // registers object, typelib and all interfaces in typelib
  74.     return _Module.RegisterServer(TRUE);
  75. }
  76.  
  77. /////////////////////////////////////////////////////////////////////////////
  78. // DllUnregisterServer - Removes entries from the system registry
  79.  
  80. STDAPI DllUnregisterServer(void)
  81. {
  82.     _Module.UnregisterServer();
  83.     return S_OK;
  84. }
  85.  
  86.  
  87.