代码拉取完成,页面将自动刷新
#if !defined MOBJECT_H
#define MOBJECT_H
//用于创建和操作以自动化为基的类。(即它所操作的对象必需支持自动化)
class CMObject
{
public:
CMObject(_variant_t& tvar);
CMObject()
{
p = NULL;
}
CMObject(IDispatch* lp)
{
if((p = lp) != NULL)
p->AddRef();
}
CMObject(IUnknown* lp)
{
p=NULL;
if (lp != NULL)
lp->QueryInterface(IID_IDispatch, (void **)&p);
}
~CMObject()
{
try
{
if (p) p->Release();
}
catch(...)
{
}
p=NULL;
}
void Release()
{
try
{
if (p) p->Release();
}
catch(...){}
p=NULL;
}
//Member Functions
public:
HRESULT CreateObject(const CLSID clsid);
HRESULT GetActiveObject(const CLSID clsid);
HRESULT CreateObject(LPCTSTR objName);
HRESULT GetActiveObject(LPCTSTR objName);
HRESULT GetIDOfName(/*LPCOLESTR*/LPCTSTR lpsz, DISPID* pdispid);
operator IDispatch*() {return p;}
IDispatch& operator*() { return *p; }
IDispatch** operator&() { return &p; }
IDispatch* operator->() {return p; }
IDispatch* operator=(IDispatch* lp);
IDispatch* operator=(IUnknown* lp);
IDispatch* operator=(_variant_t& newVar);
BOOL operator!(){return (p == NULL) ? TRUE : FALSE;}
_variant_t GetPropertyByName(/*LPCOLESTR*/LPCTSTR lpsz);
_variant_t GetProperty(DISPID dwDispID);
HRESULT PutPropertyByName(/*LPCOLESTR*/LPCTSTR lpsz, VARIANT* pVar);
HRESULT PutProperty(DISPID dwDispID, VARIANT* pVar);
static HRESULT GetProperty(IDispatch* pDisp, DISPID dwDispID,
VARIANT* pVar);
static HRESULT PutProperty(IDispatch* pDisp, DISPID dwDispID,
VARIANT* pVar);
_variant_t Invoke0(DISPID dispid);
_variant_t Invoke0(/*LPCOLESTR*/LPCTSTR lpszName);
_variant_t Invoke(DISPID dispid, long nParamCount, VARIANT * ...);
_variant_t Invoke(LPCTSTR sName,long nParamCount,VARIANT* ...);
//Member Variant
public:
IDispatch* p;
protected:
_variant_t InvokeV(DISPID dispid,long nParamCount,va_list argList);
};
#endif
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。