TCUtility.h 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. #ifndef __TCUtility_h__
  2. #define __TCUtility_h__
  3. /////////////////////////////////////////////////////////////////////////////
  4. // TCUtility.h | Declaration of the CTCUtility class, which implements the
  5. // CLSID_TCUtility component object.
  6. #include "resource.h" // main symbols
  7. #include "SrcInc.h"
  8. #include <TCObj.h>
  9. #include <objsafe.h>
  10. /////////////////////////////////////////////////////////////////////////////
  11. // CTCUtility
  12. class ATL_NO_VTABLE CTCUtility :
  13. public IDispatchImpl<ITCUtility, &IID_ITCUtility, &LIBID_TCObj>,
  14. public CComCoClass<CTCUtility, &CLSID_TCUtility>,
  15. public CComObjectRoot
  16. {
  17. // Declarations
  18. public:
  19. DECLARE_REGISTRY_RESOURCEID(IDR_TCUtility)
  20. DECLARE_GET_CONTROLLING_UNKNOWN()
  21. // Category Map
  22. public:
  23. BEGIN_CATEGORY_MAP(CTCUtility)
  24. IMPLEMENTED_CATEGORY(CATID_TCObj)
  25. IMPLEMENTED_CATEGORY(CATID_SafeForScripting)
  26. IMPLEMENTED_CATEGORY(CATID_SafeForInitializing)
  27. END_CATEGORY_MAP()
  28. // Interface Map
  29. public:
  30. BEGIN_COM_MAP(CTCUtility)
  31. COM_INTERFACE_ENTRY(ITCUtility)
  32. COM_INTERFACE_ENTRY2(IDispatch, ITCUtility)
  33. END_COM_MAP()
  34. // Construction / Destruction
  35. public:
  36. CTCUtility() {}
  37. // ITCUtility Interface Methods
  38. public:
  39. STDMETHODIMP CreateObject(BSTR bstrProgID, BSTR bstrComputer,
  40. IUnknown** ppUnk);
  41. STDMETHODIMP ObjectReference(IUnknown* pUnk, BSTR* pbstrObjectReference);
  42. STDMETHODIMP Sleep(long nDurationMS);
  43. STDMETHODIMP GetObject(BSTR bstrMoniker, VARIANT_BOOL bAllowUI,
  44. long nTimeoutMS, IUnknown** ppUnk);
  45. };
  46. /////////////////////////////////////////////////////////////////////////////
  47. #endif // !__TCUtility_h__