本文整理汇总了C++中ITypeInfo::Invoke方法的典型用法代码示例。如果您正苦于以下问题:C++ ITypeInfo::Invoke方法的具体用法?C++ ITypeInfo::Invoke怎么用?C++ ITypeInfo::Invoke使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ITypeInfo
的用法示例。
在下文中一共展示了ITypeInfo::Invoke方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: InvokeException
HRESULT
Reference::invoke (MEMBERID memberid,
WORD dispatchFlags,
const TypedArguments &arguments,
VARIANT *pResult)
{
if (m_pInterface != 0 && !m_pInterface->dispatchOnly()) {
EXCEPINFO excepInfo;
memset(&excepInfo, 0, sizeof(excepInfo));
unsigned argErr;
// Invoke through virtual function table.
ITypeInfo *pTypeInfo = interfaceDesc()->typeInfo();
HRESULT hr = pTypeInfo->Invoke(
m_pUnknown,
memberid,
dispatchFlags,
arguments.dispParams(),
pResult,
&excepInfo,
&argErr);
if (SUCCEEDED(hr)) {
return hr;
}
if (hr == DISP_E_EXCEPTION) {
throwDispatchException(excepInfo);
} else if (hr == DISP_E_TYPEMISMATCH || hr == DISP_E_PARAMNOTFOUND) {
throw InvokeException(hr, arguments.dispParams()->cArgs - argErr);
}
}
return invokeDispatch(memberid, dispatchFlags, arguments, pResult);
}
示例2: GetTypeInfo
STDMETHODIMP
CMediaPosition::Invoke(
DISPID dispidMember,
REFIID riid,
LCID lcid,
WORD wFlags,
DISPPARAMS * pdispparams,
VARIANT * pvarResult,
EXCEPINFO * pexcepinfo,
UINT * puArgErr)
{
// this parameter is a dead leftover from an earlier interface
if (IID_NULL != riid) {
return DISP_E_UNKNOWNINTERFACE;
}
ITypeInfo * pti;
HRESULT hr = GetTypeInfo(0, lcid, &pti);
if (FAILED(hr)) {
return hr;
}
hr = pti->Invoke(
(IMediaPosition *)this,
dispidMember,
wFlags,
pdispparams,
pvarResult,
pexcepinfo,
puArgErr);
pti->Release();
return hr;
}
示例3: Invoke
HRESULT CComTypeInfoHolder::Invoke(IDispatch* p, DISPID dispidMember, REFIID /*riid*/,
LCID lcid, WORD wFlags, DISPPARAMS* pdispparams, VARIANT* pvarResult,
EXCEPINFO* pexcepinfo, UINT* puArgErr)
{
SetErrorInfo(0, NULL);
ITypeInfo* pInfo;;
HRESULT hRes = GetTI(lcid, &pInfo);
return (pInfo != NULL) ?
pInfo->Invoke(p, dispidMember, wFlags, pdispparams, pvarResult, pexcepinfo, puArgErr) :
hRes;
}
示例4: Invoke
STDMETHODIMP CJServer::Invoke(DISPID dispID, REFIID riid
, LCID lcid, unsigned short wFlags, DISPPARAMS *pDispParams
, VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
{
HRESULT hr;
ITypeInfo *pTI;
LANGID langID=PRIMARYLANGID(lcid);
if (IID_NULL!=riid) return DISP_E_UNKNOWNINTERFACE;
hr=GetTypeInfo(0, lcid, &pTI);
if (FAILED(hr)) return hr;
//This is exactly what DispInvoke does--so skip the overhead.
hr=pTI->Invoke((SERVERCLASS *)this, dispID, wFlags
, pDispParams, pVarResult, pExcepInfo, puArgErr);
//Exception handling is done within ITypeInfo::Invoke
pTI->Release();
return hr;
}