home *** CD-ROM | disk | FTP | other *** search
/ Personal Computer World 2002 March / PCWMAR02.iso / software / turbocad / v8trial / TurboCADv8ProfessionalNoReg.exe / Data.Cab / F38811_TCPssWiz.cpp < prev    next >
Encoding:
C/C++ Source or Header  |  2001-10-16  |  3.2 KB  |  109 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. // TCPssWiz.cpp : Implementation of DLL Exports.
  12.  
  13.  
  14. // Note: Proxy/Stub Information
  15. //      To build a separate proxy/stub DLL, 
  16. //      run nmake -f TCPssWizps.mk in the project directory.
  17.  
  18. #include "stdafx.h"
  19. #include "resource.h"
  20. #include <initguid.h>
  21. #include "TCPssWiz.h"
  22.  
  23. #include "TCPssWiz_i.c"
  24. #include "PSsWizard.h"
  25.  
  26.  
  27. CComModule _Module;
  28. COleVariant varMissing((long)DISP_E_PARAMNOTFOUND, VT_ERROR);
  29.  
  30. BEGIN_OBJECT_MAP(ObjectMap)
  31. OBJECT_ENTRY(CLSID_PSsWizard, CPSsWizard)
  32. END_OBJECT_MAP()
  33.  
  34. class CTCPssWizApp : public CWinApp
  35. {
  36. public:
  37.  
  38. // Overrides
  39.     // ClassWizard generated virtual function overrides
  40.     //{{AFX_VIRTUAL(CTCPssWizApp)
  41.     public:
  42.     virtual BOOL InitInstance();
  43.     virtual int ExitInstance();
  44.     //}}AFX_VIRTUAL
  45.  
  46.     //{{AFX_MSG(CTCPssWizApp)
  47.         // NOTE - the ClassWizard will add and remove member functions here.
  48.         //    DO NOT EDIT what you see in these blocks of generated code !
  49.     //}}AFX_MSG
  50.     DECLARE_MESSAGE_MAP()
  51. };
  52.  
  53. BEGIN_MESSAGE_MAP(CTCPssWizApp, CWinApp)
  54.     //{{AFX_MSG_MAP(CTCPssWizApp)
  55.         // NOTE - the ClassWizard will add and remove mapping macros here.
  56.         //    DO NOT EDIT what you see in these blocks of generated code!
  57.     //}}AFX_MSG_MAP
  58. END_MESSAGE_MAP()
  59.  
  60. CTCPssWizApp theApp;
  61.  
  62. BOOL CTCPssWizApp::InitInstance()
  63. {
  64.     _Module.Init(ObjectMap, m_hInstance, &LIBID_TCPSSWIZLib);
  65.     return CWinApp::InitInstance();
  66. }
  67.  
  68. int CTCPssWizApp::ExitInstance()
  69. {
  70.     _Module.Term();
  71.     return CWinApp::ExitInstance();
  72. }
  73.  
  74. /////////////////////////////////////////////////////////////////////////////
  75. // Used to determine whether the DLL can be unloaded by OLE
  76.  
  77. STDAPI DllCanUnloadNow(void)
  78. {
  79.     AFX_MANAGE_STATE(AfxGetStaticModuleState());
  80.     return (AfxDllCanUnloadNow()==S_OK && _Module.GetLockCount()==0) ? S_OK : S_FALSE;
  81. }
  82.  
  83. /////////////////////////////////////////////////////////////////////////////
  84. // Returns a class factory to create an object of the requested type
  85.  
  86. STDAPI DllGetClassObject(REFCLSID rclsid, REFIID riid, LPVOID* ppv)
  87. {
  88.     return _Module.GetClassObject(rclsid, riid, ppv);
  89. }
  90.  
  91. /////////////////////////////////////////////////////////////////////////////
  92. // DllRegisterServer - Adds entries to the system registry
  93.  
  94. STDAPI DllRegisterServer(void)
  95. {
  96.     // registers object, typelib and all interfaces in typelib
  97.     return _Module.RegisterServer(TRUE);
  98. }
  99.  
  100. /////////////////////////////////////////////////////////////////////////////
  101. // DllUnregisterServer - Removes entries from the system registry
  102.  
  103. STDAPI DllUnregisterServer(void)
  104. {
  105.     return _Module.UnregisterServer(TRUE);
  106. }
  107.  
  108.  
  109.