本文整理汇总了C++中ITypeInfo_GetIDsOfNames函数的典型用法代码示例。如果您正苦于以下问题:C++ ITypeInfo_GetIDsOfNames函数的具体用法?C++ ITypeInfo_GetIDsOfNames怎么用?C++ ITypeInfo_GetIDsOfNames使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了ITypeInfo_GetIDsOfNames函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: queryresult_GetIDsOfNames
static HRESULT WINAPI queryresult_GetIDsOfNames(
IXMLDOMNodeList *iface,
REFIID riid,
LPOLESTR* rgszNames,
UINT cNames,
LCID lcid,
DISPID* rgDispId )
{
queryresult *This = impl_from_IXMLDOMNodeList( iface );
ITypeInfo *typeinfo;
HRESULT hr;
TRACE("(%p)->(%s %p %u %u %p)\n", This, debugstr_guid(riid), rgszNames, cNames,
lcid, rgDispId);
if(!rgszNames || cNames == 0 || !rgDispId)
return E_INVALIDARG;
hr = get_typeinfo(IXMLDOMNodeList_tid, &typeinfo);
if(SUCCEEDED(hr))
{
hr = ITypeInfo_GetIDsOfNames(typeinfo, rgszNames, cNames, rgDispId);
ITypeInfo_Release(typeinfo);
}
return hr;
}
示例2: vbdisp_get_id
HRESULT vbdisp_get_id(vbdisp_t *This, BSTR name, vbdisp_invoke_type_t invoke_type, BOOL search_private, DISPID *id)
{
unsigned i;
if(get_func_id(This, name, invoke_type, search_private, id))
return S_OK;
for(i=0; i < This->desc->prop_cnt; i++) {
if(!search_private && !This->desc->props[i].is_public)
continue;
if(!strcmpiW(This->desc->props[i].name, name)) {
*id = i + This->desc->func_cnt;
return S_OK;
}
}
if(This->desc->typeinfo) {
HRESULT hres;
hres = ITypeInfo_GetIDsOfNames(This->desc->typeinfo, &name, 1, id);
if(SUCCEEDED(hres))
return S_OK;
}
*id = -1;
return DISP_E_UNKNOWNNAME;
}
示例3: DispGetIDsOfNames
/******************************************************************************
* DispGetIDsOfNames (OLEAUT32.29)
*
* Convert a set of parameter names to DISPIDs for DispInvoke().
*
* RETURNS
* Success: S_OK.
* Failure: An HRESULT error code.
*
* NOTES
* This call defers to ITypeInfo_GetIDsOfNames(). The ITypeInfo interface passed
* as ptinfo contains the information to map names to DISPIDs.
*/
HRESULT WINAPI DispGetIDsOfNames(
ITypeInfo *ptinfo, /* [in] Object's type info */
OLECHAR **rgszNames, /* [in] Array of names to get DISPIDs for */
UINT cNames, /* [in] Number of names in rgszNames */
DISPID *rgdispid) /* [out] Destination for converted DISPIDs */
{
return ITypeInfo_GetIDsOfNames(ptinfo, rgszNames, cNames, rgdispid);
}
示例4: Host_GetIDsOfNames
static HRESULT WINAPI Host_GetIDsOfNames(IHost *iface, REFIID riid, LPOLESTR *rgszNames,
UINT cNames, LCID lcid, DISPID *rgDispId)
{
WINE_TRACE("(%s %p %d %x %p)\n", wine_dbgstr_guid(riid), rgszNames,
cNames, lcid, rgDispId);
return ITypeInfo_GetIDsOfNames(host_ti, rgszNames, cNames, rgDispId);
}
示例5: ShellDispatch_GetIDsOfNames
static HRESULT WINAPI ShellDispatch_GetIDsOfNames(IShellDispatch2 *iface,
REFIID riid, LPOLESTR *rgszNames, UINT cNames, LCID lcid, DISPID *rgDispId)
{
ShellDispatch *This = impl_from_IShellDispatch2(iface);
TRACE("(%p,%p,%p,%u,%d,%p)\n", iface, riid, rgszNames, cNames, lcid,
rgDispId);
return ITypeInfo_GetIDsOfNames(This->typeinfo, rgszNames, cNames, rgDispId);
}
示例6: MatchCollection2_GetIDsOfNames
static HRESULT WINAPI MatchCollection2_GetIDsOfNames(IMatchCollection2 *iface,
REFIID riid, LPOLESTR *rgszNames, UINT cNames, LCID lcid, DISPID *rgDispId)
{
MatchCollection2 *This = impl_from_IMatchCollection2(iface);
TRACE("(%p)->(%s %p %u %u %p)\n", This, debugstr_guid(riid),
rgszNames, cNames, lcid, rgDispId);
return ITypeInfo_GetIDsOfNames(typeinfos[MatchCollection2_tid], rgszNames, cNames, rgDispId);
}
示例7: FolderImpl_GetIDsOfNames
static HRESULT WINAPI FolderImpl_GetIDsOfNames(Folder3 *iface, REFIID riid,
LPOLESTR *rgszNames, UINT cNames, LCID lcid, DISPID *rgDispId)
{
FolderImpl *This = impl_from_Folder(iface);
TRACE("(%p,%p,%p,%u,%d,%p)\n", iface, riid, rgszNames, cNames, lcid,
rgDispId);
return ITypeInfo_GetIDsOfNames(This->iTypeInfo, rgszNames, cNames,
rgDispId);
}
示例8: ShellDispatch_GetIDsOfNames
static HRESULT WINAPI ShellDispatch_GetIDsOfNames(IShellDispatch5 *iface,
REFIID riid, LPOLESTR *rgszNames, UINT cNames, LCID lcid, DISPID *rgDispId)
{
ITypeInfo *ti;
HRESULT hr;
TRACE("(%p,%p,%p,%u,%d,%p)\n", iface, riid, rgszNames, cNames, lcid,
rgDispId);
hr = get_typeinfo(IShellDispatch5_tid, &ti);
if (SUCCEEDED(hr))
hr = ITypeInfo_GetIDsOfNames(ti, rgszNames, cNames, rgDispId);
return hr;
}
示例9: php_com_get_id_of_name
/* map an ID to a name */
HRESULT php_com_get_id_of_name(php_com_dotnet_object *obj, char *name,
size_t namelen, DISPID *dispid)
{
OLECHAR *olename;
HRESULT hr;
zval *tmp;
if (namelen == -1) {
namelen = strlen(name);
}
if (obj->id_of_name_cache && NULL != (tmp = zend_hash_str_find(obj->id_of_name_cache, name, namelen))) {
*dispid = (DISPID)Z_LVAL_P(tmp);
return S_OK;
}
olename = php_com_string_to_olestring(name, namelen, obj->code_page);
if (obj->typeinfo) {
hr = ITypeInfo_GetIDsOfNames(obj->typeinfo, &olename, 1, dispid);
if (FAILED(hr)) {
hr = IDispatch_GetIDsOfNames(V_DISPATCH(&obj->v), &IID_NULL, &olename, 1, LOCALE_SYSTEM_DEFAULT, dispid);
if (SUCCEEDED(hr)) {
/* fall back on IDispatch direct */
ITypeInfo_Release(obj->typeinfo);
obj->typeinfo = NULL;
}
}
} else {
hr = IDispatch_GetIDsOfNames(V_DISPATCH(&obj->v), &IID_NULL, &olename, 1, LOCALE_SYSTEM_DEFAULT, dispid);
}
efree(olename);
if (SUCCEEDED(hr)) {
zval tmp;
/* cache the mapping */
if (!obj->id_of_name_cache) {
ALLOC_HASHTABLE(obj->id_of_name_cache);
zend_hash_init(obj->id_of_name_cache, 2, NULL, NULL, 0);
}
ZVAL_LONG(&tmp, *dispid);
zend_hash_str_update(obj->id_of_name_cache, name, namelen, &tmp);
}
return hr;
}
示例10: WebBrowser_GetIDsOfNames
static HRESULT WINAPI WebBrowser_GetIDsOfNames(IWebBrowser2 *iface, REFIID riid,
LPOLESTR *rgszNames, UINT cNames,
LCID lcid, DISPID *rgDispId)
{
WebBrowser *This = impl_from_IWebBrowser2(iface);
ITypeInfo *typeinfo;
HRESULT hres;
TRACE("(%p)->(%s %p %d %d %p)\n", This, debugstr_guid(riid), rgszNames, cNames,
lcid, rgDispId);
hres = get_typeinfo(IWebBrowser2_tid, &typeinfo);
if(FAILED(hres))
return hres;
return ITypeInfo_GetIDsOfNames(typeinfo, rgszNames, cNames, rgDispId);
}
示例11: WshShell3_GetIDsOfNames
static HRESULT WINAPI WshShell3_GetIDsOfNames(IWshShell3 *iface, REFIID riid, LPOLESTR *rgszNames,
UINT cNames, LCID lcid, DISPID *rgDispId)
{
ITypeInfo *typeinfo;
HRESULT hr;
TRACE("(%s %p %u %u %p)\n", debugstr_guid(riid), rgszNames, cNames, lcid, rgDispId);
hr = get_typeinfo(IWshShell3_tid, &typeinfo);
if(SUCCEEDED(hr))
{
hr = ITypeInfo_GetIDsOfNames(typeinfo, rgszNames, cNames, rgDispId);
ITypeInfo_Release(typeinfo);
}
return hr;
}
示例12: WshCollection_GetIDsOfNames
static HRESULT WINAPI WshCollection_GetIDsOfNames(IWshCollection *iface, REFIID riid, LPOLESTR *rgszNames,
UINT cNames, LCID lcid, DISPID *rgDispId)
{
WshCollection *This = impl_from_IWshCollection(iface);
ITypeInfo *typeinfo;
HRESULT hr;
TRACE("(%p)->(%s %p %u %u %p)\n", This, debugstr_guid(riid), rgszNames, cNames, lcid, rgDispId);
hr = get_typeinfo(IWshCollection_tid, &typeinfo);
if(SUCCEEDED(hr))
{
hr = ITypeInfo_GetIDsOfNames(typeinfo, rgszNames, cNames, rgDispId);
ITypeInfo_Release(typeinfo);
}
return hr;
}
示例13: fw_apps_GetIDsOfNames
static HRESULT WINAPI fw_apps_GetIDsOfNames(
INetFwAuthorizedApplications *iface,
REFIID riid,
LPOLESTR *rgszNames,
UINT cNames,
LCID lcid,
DISPID *rgDispId )
{
fw_apps *This = impl_from_INetFwAuthorizedApplications( iface );
ITypeInfo *typeinfo;
HRESULT hr;
TRACE("%p %s %p %u %u %p\n", This, debugstr_guid(riid), rgszNames, cNames, lcid, rgDispId);
hr = get_typeinfo( INetFwAuthorizedApplications_tid, &typeinfo );
if (SUCCEEDED(hr))
{
hr = ITypeInfo_GetIDsOfNames( typeinfo, rgszNames, cNames, rgDispId );
ITypeInfo_Release( typeinfo );
}
return hr;
}
示例14: IEventListenerDemoImpl_GetIDsOfNames
static HRESULT IEventListenerDemoImpl_GetIDsOfNames(IEventListenerDemo *pThis, REFIID riid, LPOLESTR *rgszNames, UINT cNames, LCID lcid, DISPID *rgDispId)
{
return ITypeInfo_GetIDsOfNames(g_pTInfoIEventListener, rgszNames, cNames, rgDispId);
}
示例15: test_TypeInfo
static void test_TypeInfo(void)
{
ITypeLib *pTypeLib;
ITypeInfo *pTypeInfo;
HRESULT hr;
static WCHAR wszBogus[] = { 'b','o','g','u','s',0 };
static WCHAR wszGetTypeInfo[] = { 'G','e','t','T','y','p','e','I','n','f','o',0 };
static WCHAR wszClone[] = {'C','l','o','n','e',0};
OLECHAR* bogus = wszBogus;
OLECHAR* pwszGetTypeInfo = wszGetTypeInfo;
OLECHAR* pwszClone = wszClone;
DISPID dispidMember;
DISPPARAMS dispparams;
hr = LoadTypeLib(wszStdOle2, &pTypeLib);
ok_ole_success(hr, LoadTypeLib);
hr = ITypeLib_GetTypeInfoOfGuid(pTypeLib, &IID_IFont, &pTypeInfo);
ok_ole_success(hr, ITypeLib_GetTypeInfoOfGuid);
/* test nonexistent method name */
hr = ITypeInfo_GetIDsOfNames(pTypeInfo, &bogus, 1, &dispidMember);
ok(hr == DISP_E_UNKNOWNNAME,
"ITypeInfo_GetIDsOfNames should have returned DISP_E_UNKNOWNNAME instead of 0x%08x\n",
hr);
/* test invalid memberid */
dispparams.cNamedArgs = 0;
dispparams.cArgs = 0;
dispparams.rgdispidNamedArgs = NULL;
dispparams.rgvarg = NULL;
hr = ITypeInfo_Invoke(pTypeInfo, (void *)0xdeadbeef, 0xdeadbeef, DISPATCH_METHOD, &dispparams, NULL, NULL, NULL);
ok(hr == DISP_E_MEMBERNOTFOUND, "ITypeInfo_Invoke should have returned DISP_E_MEMBERNOTFOUND instead of 0x%08x\n", hr);
hr = ITypeInfo_GetIDsOfNames(pTypeInfo, &pwszClone, 1, &dispidMember);
ok_ole_success(hr, ITypeInfo_GetIDsOfNames);
/* test correct memberid, but wrong flags */
hr = ITypeInfo_Invoke(pTypeInfo, (void *)0xdeadbeef, dispidMember, DISPATCH_PROPERTYGET, &dispparams, NULL, NULL, NULL);
ok(hr == DISP_E_MEMBERNOTFOUND, "ITypeInfo_Invoke should have returned DISP_E_MEMBERNOTFOUND instead of 0x%08x\n", hr);
/* test NULL dispparams */
hr = ITypeInfo_Invoke(pTypeInfo, (void *)0xdeadbeef, dispidMember, DISPATCH_METHOD, NULL, NULL, NULL, NULL);
ok(hr == E_INVALIDARG, "ITypeInfo_Invoke should have returned E_INVALIDARG instead of 0x%08x\n", hr);
/* test dispparams->cNamedArgs being bigger than dispparams->cArgs */
dispparams.cNamedArgs = 1;
hr = ITypeInfo_Invoke(pTypeInfo, (void *)0xdeadbeef, dispidMember, DISPATCH_METHOD, &dispparams, NULL, NULL, NULL);
ok(hr == E_INVALIDARG, "ITypeInfo_Invoke should have returned E_INVALIDARG instead of 0x%08x\n", hr);
ITypeInfo_Release(pTypeInfo);
hr = ITypeLib_GetTypeInfoOfGuid(pTypeLib, &IID_IDispatch, &pTypeInfo);
ok_ole_success(hr, ITypeLib_GetTypeInfoOfGuid);
hr = ITypeInfo_GetIDsOfNames(pTypeInfo, &pwszGetTypeInfo, 1, &dispidMember);
ok_ole_success(hr, ITypeInfo_GetIDsOfNames);
/* test invoking a method with a [restricted] keyword */
hr = ITypeInfo_Invoke(pTypeInfo, NULL, dispidMember, DISPATCH_METHOD, &dispparams, NULL, NULL, NULL);
todo_wine {
ok(hr == DISP_E_MEMBERNOTFOUND, "ITypeInfo_Invoke should have returned DISP_E_MEMBERNOTFOUND instead of 0x%08x\n", hr);
}
ITypeInfo_Release(pTypeInfo);
ITypeLib_Release(pTypeLib);
}