Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

46 lines
2.4 KiB

  1. interface _VBComponent;
  2. DEFINE_GUID(IID__VBComponent,0xC224F73FL,0x8D72,0x11D2,0x8A,0x0B,0x00,0x00,0x21,0x47,0x31,0x28);
  3. DECLARE_INTERFACE_(_VBComponent, IDispatch)
  4. {
  5. STDMETHOD(StartAnimation)(THIS) PURE;
  6. STDMETHOD(StopAnimation)(THIS) PURE;
  7. };
  8. DEFINE_GUID(CLSID_VBComponent,0xCD3A5DAAL,0x8CA5,0x11D2,0x8A,0x0B,0x00,0x00,0x21,0x47,0x31,0x28);
  9. class CWrapVBComponent : public _VBComponent
  10. {
  11. public:
  12. STDMETHOD(QueryInterface)(THIS_ REFIID riid, void FAR* FAR* ppvObj){ return m_pInternal->QueryInterface(riid, ppvObj); }
  13. STDMETHOD_(unsigned long, AddRef)(THIS){ return m_pInternal->AddRef(); }
  14. STDMETHOD_(unsigned long, Release)(THIS){ return m_pInternal->Release(); }
  15. STDMETHOD(GetTypeInfoCount)(THIS_ unsigned int FAR* pctinfo){ return m_pInternal->GetTypeInfoCount(pctinfo); }
  16. STDMETHOD(GetTypeInfo)(THIS_ unsigned int itinfo, unsigned long lcid, ITypeInfo FAR* FAR* pptinfo){ return m_pInternal->GetTypeInfo(itinfo, lcid, pptinfo); }
  17. STDMETHOD(GetIDsOfNames)(THIS_ REFIID riid, unsigned short FAR* FAR* rgszNames, unsigned int cNames, unsigned long lcid, long FAR* rgdispid){ return m_pInternal->GetIDsOfNames(riid,
  18. rgszNames, cNames, lcid, rgdispid); }
  19. STDMETHOD(Invoke)(THIS_ long dispidMember, REFIID riid, unsigned long lcid, unsigned short wFlags, DISPPARAMS FAR* pdispparams, VARIANT FAR* pvarResult, EXCEPINFO
  20. FAR* pexcepinfo, unsigned int FAR* puArgErr){ return m_pInternal->Invoke(dispidMember, riid, lcid, wFlags, pdispparams, pvarResult, pexcepinfo, puArgErr); }
  21. STDMETHOD(StartAnimation)(THIS){ return m_pInternal->StartAnimation(); }
  22. STDMETHOD(StopAnimation)(THIS){ return m_pInternal->StopAnimation(); }
  23. CWrapVBComponent()
  24. {
  25. m_pInternal = NULL;
  26. IUnknown FAR* pUnk;
  27. if SUCCEEDED(m_hrLaunch = CoCreateInstance(CLSID_VBComponent, NULL, CLSCTX_SERVER,
  28. IID_IUnknown, (void FAR* FAR*) &pUnk)) {
  29. m_hrLaunch = pUnk->QueryInterface(IID__VBComponent, (void FAR* FAR*) &m_pInternal);
  30. pUnk->Release();
  31. }
  32. }
  33. CWrapVBComponent(IUnknown *pUnk)
  34. {
  35. m_pInternal = NULL;
  36. m_hrLaunch = pUnk->QueryInterface(IID__VBComponent, (void FAR* FAR*) &m_pInternal);
  37. }
  38. virtual ~CWrapVBComponent(){if (m_pInternal) m_pInternal->Release();}
  39. HRESULT LaunchError(){return m_hrLaunch;}
  40. private:
  41. _VBComponent FAR* m_pInternal;
  42. HRESULT m_hrLaunch;
  43. };