本文整理汇总了C++中ITypeLib_Release函数的典型用法代码示例。如果您正苦于以下问题:C++ ITypeLib_Release函数的具体用法?C++ ITypeLib_Release怎么用?C++ ITypeLib_Release使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了ITypeLib_Release函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: GetRecordInfoFromGuids
/******************************************************************************
* GetRecordInfoFromGuids [OLEAUT32.322]
*
* RETURNS
* Success: S_OK
* Failure: E_INVALIDARG, if any argument is invalid.
*/
HRESULT WINAPI GetRecordInfoFromGuids(REFGUID rGuidTypeLib, ULONG uVerMajor,
ULONG uVerMinor, LCID lcid, REFGUID rGuidTypeInfo, IRecordInfo** ppRecInfo)
{
ITypeInfo *pTypeInfo;
ITypeLib *pTypeLib;
HRESULT hres;
TRACE("(%p,%d,%d,%d,%s,%p)\n", rGuidTypeLib, uVerMajor, uVerMinor,
lcid, debugstr_guid(rGuidTypeInfo), ppRecInfo);
hres = LoadRegTypeLib(rGuidTypeLib, uVerMajor, uVerMinor, lcid, &pTypeLib);
if(FAILED(hres)) {
WARN("LoadRegTypeLib failed!\n");
return hres;
}
hres = ITypeLib_GetTypeInfoOfGuid(pTypeLib, rGuidTypeInfo, &pTypeInfo);
ITypeLib_Release(pTypeLib);
if(FAILED(hres)) {
WARN("GetTypeInfoOfGuid failed!\n");
return hres;
}
hres = GetRecordInfoFromTypeInfo(pTypeInfo, ppRecInfo);
ITypeInfo_Release(pTypeInfo);
return hres;
}
开发者ID:RPG-7,项目名称:reactos,代码行数:34,代码来源:recinfo.c
示例2: get_typeinfo
static HRESULT get_typeinfo(tid_t tid, ITypeInfo **typeinfo)
{
HRESULT hres;
if(!typelib) {
ITypeLib *tl;
hres = LoadRegTypeLib(&LIBID_MSHTML, 4, 0, LOCALE_SYSTEM_DEFAULT, &tl);
if(FAILED(hres)) {
ERR("LoadRegTypeLib failed: %08x\n", hres);
return hres;
}
if(InterlockedCompareExchangePointer((void**)&typelib, tl, NULL))
ITypeLib_Release(tl);
}
if(!typeinfos[tid]) {
ITypeInfo *typeinfo;
hres = ITypeLib_GetTypeInfoOfGuid(typelib, tid_ids[tid], &typeinfo);
if(FAILED(hres)) {
ERR("GetTypeInfoOfGuid(%s) failed: %08x\n", debugstr_guid(tid_ids[tid]), hres);
return hres;
}
if(InterlockedCompareExchangePointer((void**)(typeinfos+tid), typeinfo, NULL))
ITypeInfo_Release(typeinfo);
}
*typeinfo = typeinfos[tid];
return S_OK;
}
开发者ID:bilboed,项目名称:wine,代码行数:33,代码来源:dispex.c
示例3: get_typeinfo
HRESULT get_typeinfo( enum type_id tid, ITypeInfo **ret )
{
HRESULT hr;
if (!typelib)
{
ITypeLib *lib;
hr = LoadRegTypeLib( &LIBID_NetFwPublicTypeLib, 1, 0, LOCALE_SYSTEM_DEFAULT, &lib );
if (FAILED(hr))
{
ERR("LoadRegTypeLib failed: %08x\n", hr);
return hr;
}
if (InterlockedCompareExchangePointer( (void **)&typelib, lib, NULL ))
ITypeLib_Release( lib );
}
if (!typeinfo[tid])
{
ITypeInfo *info;
hr = ITypeLib_GetTypeInfoOfGuid( typelib, tid_id[tid], &info );
if (FAILED(hr))
{
ERR("GetTypeInfoOfGuid(%s) failed: %08x\n", debugstr_guid(tid_id[tid]), hr);
return hr;
}
if (InterlockedCompareExchangePointer( (void **)(typeinfo + tid), info, NULL ))
ITypeInfo_Release( info );
}
*ret = typeinfo[tid];
ITypeInfo_AddRef(typeinfo[tid]);
return S_OK;
}
开发者ID:amaneureka,项目名称:reactos,代码行数:34,代码来源:apps.c
示例4: init_regexp_typeinfo
static HRESULT init_regexp_typeinfo(regexp_tid_t tid)
{
HRESULT hres;
if(!typelib) {
static const WCHAR vbscript_dll3W[] = {'v','b','s','c','r','i','p','t','.','d','l','l','\\','3',0};
ITypeLib *tl;
hres = LoadTypeLib(vbscript_dll3W, &tl);
if(FAILED(hres)) {
ERR("LoadRegTypeLib failed: %08x\n", hres);
return hres;
}
if(InterlockedCompareExchangePointer((void**)&typelib, tl, NULL))
ITypeLib_Release(tl);
}
if(!typeinfos[tid]) {
ITypeInfo *ti;
hres = ITypeLib_GetTypeInfoOfGuid(typelib, tid_ids[tid], &ti);
if(FAILED(hres)) {
ERR("GetTypeInfoOfGuid(%s) failed: %08x\n", debugstr_guid(tid_ids[tid]), hres);
return hres;
}
if(InterlockedCompareExchangePointer((void**)(typeinfos+tid), ti, NULL))
ITypeInfo_Release(ti);
}
return S_OK;
}
开发者ID:DeltaYang,项目名称:wine,代码行数:33,代码来源:vbregexp.c
示例5: get_typeinfo
HRESULT get_typeinfo(enum tid_t tid, ITypeInfo **typeinfo)
{
HRESULT hres;
if(!typelib) {
ITypeLib *tl;
hres = LoadRegTypeLib(&LIBID_MSXML2, 3, 0, LOCALE_SYSTEM_DEFAULT, &tl);
if(FAILED(hres)) {
ERR("LoadRegTypeLib failed: %08x\n", hres);
return hres;
}
if(InterlockedCompareExchangePointer((void**)&typelib, tl, NULL))
ITypeLib_Release(tl);
}
if(!typeinfos[tid]) {
ITypeInfo *ti;
hres = ITypeLib_GetTypeInfoOfGuid(typelib, tid_ids[tid], &ti);
if(FAILED(hres)) {
ERR("GetTypeInfoOfGuid failed: %08x\n", hres);
return hres;
}
if(InterlockedCompareExchangePointer((void**)(typeinfos+tid), ti, NULL))
ITypeInfo_Release(ti);
}
*typeinfo = typeinfos[tid];
ITypeInfo_AddRef(typeinfos[tid]);
return S_OK;
}
开发者ID:zapot,项目名称:vinassa,代码行数:35,代码来源:dispex.c
示例6: test_typelib
static void test_typelib(void)
{
ITypeLib *typelib;
HINSTANCE inst;
size_t len;
BSTR path;
HRESULT hres;
static const WCHAR scrrun_dll_suffixW[] = {'\\','s','c','r','r','u','n','.','d','l','l',0};
static const WCHAR mshtml_tlb_suffixW[] = {'\\','m','s','h','t','m','l','.','t','l','b',0};
inst = LoadLibraryA("scrrun.dll");
ok(inst != NULL, "Could not load scrrun.dll\n");
typelib = NULL;
hres = AtlLoadTypeLib(inst, NULL, &path, &typelib);
ok(hres == S_OK, "AtlLoadTypeLib failed: %08x\n", hres);
FreeLibrary(inst);
len = SysStringLen(path);
ok(len > sizeof(scrrun_dll_suffixW)/sizeof(WCHAR)
&& lstrcmpiW(path+len-sizeof(scrrun_dll_suffixW)/sizeof(WCHAR), scrrun_dll_suffixW),
"unexpected path %s\n", wine_dbgstr_w(path));
SysFreeString(path);
ok(typelib != NULL, "typelib == NULL\n");
ITypeLib_Release(typelib);
inst = LoadLibraryA("mshtml.dll");
ok(inst != NULL, "Could not load mshtml.dll\n");
typelib = NULL;
hres = AtlLoadTypeLib(inst, NULL, &path, &typelib);
ok(hres == S_OK, "AtlLoadTypeLib failed: %08x\n", hres);
FreeLibrary(inst);
len = SysStringLen(path);
ok(len > sizeof(mshtml_tlb_suffixW)/sizeof(WCHAR)
&& lstrcmpiW(path+len-sizeof(mshtml_tlb_suffixW)/sizeof(WCHAR), mshtml_tlb_suffixW),
"unexpected path %s\n", wine_dbgstr_w(path));
SysFreeString(path);
ok(typelib != NULL, "typelib == NULL\n");
ITypeLib_Release(typelib);
}
开发者ID:PatroxGaurab,项目名称:wine,代码行数:43,代码来源:atl.c
示例7: release_typelib
void release_typelib(void)
{
unsigned i;
for (i = 0; i < sizeof(typeinfo)/sizeof(*typeinfo); i++)
if (typeinfo[i])
ITypeInfo_Release(typeinfo[i]);
if (typelib)
ITypeLib_Release(typelib);
}
开发者ID:DusteDdk,项目名称:wine-multimedia,代码行数:11,代码来源:apps.c
示例8: release_regexp_typelib
void release_regexp_typelib(void)
{
DWORD i;
for(i=0; i<REGEXP_LAST_tid; i++) {
if(typeinfos[i])
ITypeInfo_Release(typeinfos[i]);
}
if(typelib)
ITypeLib_Release(typelib);
}
开发者ID:Dimillian,项目名称:wine,代码行数:11,代码来源:vbregexp.c
示例9: release_typelib
static void release_typelib(void)
{
unsigned i;
if(!typelib)
return;
for(i=0; i < sizeof(typeinfos)/sizeof(*typeinfos); i++)
if(typeinfos[i])
ITypeInfo_Release(typeinfos[i]);
ITypeLib_Release(typelib);
}
开发者ID:AndreRH,项目名称:wine,代码行数:13,代码来源:scrrun.c
示例10: LoadTypeInfo
static HRESULT LoadTypeInfo(REFIID riid, ITypeInfo **pTInfo)
{
HRESULT rc;
ITypeLib *pTypeLib;
rc = LoadRegTypeLib(&LIBID_VirtualBox, 1 /* major */, 0 /* minor */, 0 /* lcid */, &pTypeLib);
if (FAILED(rc))
return rc;
rc = ITypeLib_GetTypeInfoOfGuid(pTypeLib, riid, pTInfo);
/* No longer need access to the type lib, release it. */
ITypeLib_Release(pTypeLib);
return rc;
}
开发者ID:svn2github,项目名称:virtualbox,代码行数:14,代码来源:tstCAPIGlue.c
示例11: load_typelib
static HRESULT load_typelib(void)
{
ITypeLib *tl;
HRESULT hr;
hr = LoadRegTypeLib(&LIBID_Shell32, 1, 0, LOCALE_SYSTEM_DEFAULT, &tl);
if (FAILED(hr)) {
ERR("LoadRegTypeLib failed: %08x\n", hr);
return hr;
}
if (InterlockedCompareExchangePointer((void**)&typelib, tl, NULL))
ITypeLib_Release(tl);
return hr;
}
开发者ID:Dimillian,项目名称:wine,代码行数:15,代码来源:shelldispatch.c
示例12: load_typelib
static HRESULT load_typelib(void)
{
HRESULT hres;
ITypeLib *tl;
hres = LoadRegTypeLib(&LIBID_IWshRuntimeLibrary, 1, 0, LOCALE_SYSTEM_DEFAULT, &tl);
if(FAILED(hres)) {
ERR("LoadRegTypeLib failed: %08x\n", hres);
return hres;
}
if(InterlockedCompareExchangePointer((void**)&typelib, tl, NULL))
ITypeLib_Release(tl);
return hres;
}
开发者ID:GYGit,项目名称:reactos,代码行数:15,代码来源:wshom_main.c
示例13: DllMain
/******************************************************************
* DllMain
*/
BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved)
{
switch (fdwReason)
{
case DLL_PROCESS_ATTACH:
msi_hInstance = hinstDLL;
DisableThreadLibraryCalls(hinstDLL);
break;
case DLL_PROCESS_DETACH:
if (msi_typelib) ITypeLib_Release( msi_typelib );
msi_dialog_unregister_class();
msi_free_handle_table();
break;
}
return TRUE;
}
开发者ID:WASSUM,项目名称:longene_travel,代码行数:19,代码来源:msi_main.c
示例14: AtlRegisterTypeLib
/***********************************************************************
* AtlRegisterTypeLib [atl80.19]
*/
HRESULT WINAPI AtlRegisterTypeLib(HINSTANCE inst, const WCHAR *index)
{
ITypeLib *typelib;
BSTR path;
HRESULT hres;
TRACE("(%p %s)\n", inst, debugstr_w(index));
hres = AtlLoadTypeLib(inst, index, &path, &typelib);
if(FAILED(hres))
return hres;
hres = RegisterTypeLib(typelib, path, NULL); /* FIXME: pass help directory */
ITypeLib_Release(typelib);
SysFreeString(path);
return hres;
}
开发者ID:Fredz66,项目名称:wine,代码行数:20,代码来源:atl80.c
示例15: load_typelib
static BOOL load_typelib(void)
{
ITypeLib *typelib;
HRESULT hres;
static const WCHAR wscript_exeW[] = {'w','s','c','r','i','p','t','.','e','x','e',0};
hres = LoadTypeLib(wscript_exeW, &typelib);
if(FAILED(hres))
return FALSE;
hres = ITypeLib_GetTypeInfoOfGuid(typelib, &IID_IHost, &host_ti);
if(SUCCEEDED(hres))
hres = ITypeLib_GetTypeInfoOfGuid(typelib, &IID_IArguments2, &arguments_ti);
ITypeLib_Release(typelib);
return SUCCEEDED(hres);
}
开发者ID:Kelimion,项目名称:wine,代码行数:18,代码来源:main.c
示例16: load_type_info
static HRESULT load_type_info(REFGUID guid, ITypeInfo **pptinfo)
{
ITypeLib *typelib;
HRESULT ret;
ret = LoadRegTypeLib(&LIBID_Shell32, 1, 0, LOCALE_SYSTEM_DEFAULT, &typelib);
if (FAILED(ret))
{
ERR("LoadRegTypeLib failed: %08x\n", ret);
return ret;
}
ret = ITypeLib_GetTypeInfoOfGuid(typelib, guid, pptinfo);
ITypeLib_Release(typelib);
if (FAILED(ret))
ERR("failed to load ITypeInfo\n");
return ret;
}
开发者ID:PatroxGaurab,项目名称:wine,代码行数:19,代码来源:shelldispatch.c
示例17: Dispatch_GetTypeInfo
static HRESULT WINAPI Dispatch_GetTypeInfo(IDispatch *iface, UINT iTInfo, LCID lcid,
ITypeInfo **ppTInfo)
{
ITypeLib *typelib;
HRESULT hres;
static const WCHAR mshtml_tlbW[] = {'m','s','h','t','m','l','.','t','l','b',0};
ok(!iTInfo, "iTInfo = %d\n", iTInfo);
ok(!lcid, "lcid = %x\n", lcid);
hres = LoadTypeLib(mshtml_tlbW, &typelib);
ok(hres == S_OK, "LoadTypeLib failed: %08x\n", hres);
hres = ITypeLib_GetTypeInfoOfGuid(typelib, &IID_IHTMLElement, ppTInfo);
ok(hres == S_OK, "GetTypeInfoOfGuid failed: %08x\n", hres);
ITypeLib_Release(typelib);
return S_OK;
}
开发者ID:PatroxGaurab,项目名称:wine,代码行数:20,代码来源:atl.c
示例18: DllRegisterServer
/***********************************************************************
* DllRegisterServer ([email protected])
*/
HRESULT WINAPI DllRegisterServer(void)
{
ITypeLib *typelib;
HRESULT hres;
static const WCHAR shdocvwW[] = {'s','h','d','o','c','v','w','.','d','l','l',0};
hres = register_server(TRUE);
if(FAILED(hres))
return hres;
hres = LoadTypeLibEx(shdocvwW, REGKIND_REGISTER, &typelib);
if(FAILED(hres)) {
ERR("Could not load typelib: %08x\n", hres);
return hres;
}
ITypeLib_Release(typelib);
return hres;
}
开发者ID:WASSUM,项目名称:longene_travel,代码行数:24,代码来源:factory.c
示例19: ITypeInfo_GetContainingTypeLib_Proxy
HRESULT CALLBACK ITypeInfo_GetContainingTypeLib_Proxy(
ITypeInfo* This,
ITypeLib** ppTLib,
UINT* pIndex)
{
ITypeLib *pTL;
UINT index;
HRESULT hr;
TRACE("(%p, %p, %p)\n", This, ppTLib, pIndex );
hr = ITypeInfo_RemoteGetContainingTypeLib_Proxy(This, &pTL, &index);
if(SUCCEEDED(hr))
{
if(pIndex)
*pIndex = index;
if(ppTLib)
*ppTLib = pTL;
else
ITypeLib_Release(pTL);
}
return hr;
}
开发者ID:howard5888,项目名称:wineT,代码行数:24,代码来源:usrmarshal.c
示例20: test_inheritance
//.........这里部分代码省略.........
/* ItestIF10 is a syntax 2 dispinterface which doesn't derive from IUnknown */
hr = ITypeLib_GetTypeInfoOfGuid(pTL, &DIID_ItestIF10, &pTI);
ok(hr == S_OK, "hr %08x\n", hr);
hr = ITypeInfo_GetTypeAttr(pTI, &pTA);
ok(hr == S_OK, "hr %08x\n", hr);
ok(pTA->typekind == TKIND_DISPATCH, "kind %04x\n", pTA->typekind);
ok(pTA->cbSizeVft == 28, "sizevft %d\n", pTA->cbSizeVft);
ok(pTA->wTypeFlags == TYPEFLAG_FDISPATCHABLE, "typeflags %x\n", pTA->wTypeFlags);
if(use_midl_tlb) {
ok(pTA->cFuncs == 3, "cfuncs %d\n", pTA->cFuncs);
ok(pTA->cImplTypes == 1, "cimpltypes %d\n", pTA->cImplTypes);
ITypeInfo_ReleaseTypeAttr(pTI, pTA);
hr = ITypeInfo_GetRefTypeOfImplType(pTI, -1, &href);
ok(hr == TYPE_E_ELEMENTNOTFOUND, "hr %08x\n", hr);
hr = ITypeInfo_GetRefTypeOfImplType(pTI, 0, &href);
ok(hr == S_OK, "hr %08x\n", hr);
hr = ITypeInfo_GetRefTypeInfo(pTI, href, &pTI_p);
ok(hr == S_OK, "hr %08x\n", hr);
hr = ITypeInfo_GetTypeAttr(pTI_p, &pTA);
ok(IsEqualGUID(&pTA->guid, &IID_IDispatch), "guid {%08x-....\n", pTA->guid.Data1);
ITypeInfo_ReleaseTypeAttr(pTI_p, pTA);
ITypeInfo_Release(pTI_p);
/* Should have three methods */
hr = ITypeInfo_GetFuncDesc(pTI, 3, &pFD);
ok(hr == TYPE_E_ELEMENTNOTFOUND, "hr %08x\n", hr);
hr = ITypeInfo_GetFuncDesc(pTI, 2, &pFD);
ok(hr == S_OK, "hr %08x\n", hr);
ok(pFD->memid == 0x60010000, "memid %08x\n", pFD->memid);
ok(pFD->oVft == 8, "oVft %d\n", pFD->oVft);
ITypeInfo_ReleaseFuncDesc(pTI, pFD);
}
ITypeInfo_Release(pTI);
/* ItestIF11 is a syntax 2 dispinterface which derives from IDispatch */
hr = ITypeLib_GetTypeInfoOfGuid(pTL, &DIID_ItestIF11, &pTI);
ok(hr == S_OK, "hr %08x\n", hr);
hr = ITypeInfo_GetTypeAttr(pTI, &pTA);
ok(hr == S_OK, "hr %08x\n", hr);
ok(pTA->typekind == TKIND_DISPATCH, "kind %04x\n", pTA->typekind);
ok(pTA->cbSizeVft == 28, "sizevft %d\n", pTA->cbSizeVft);
ok(pTA->wTypeFlags == TYPEFLAG_FDISPATCHABLE, "typeflags %x\n", pTA->wTypeFlags);
if(use_midl_tlb) {
ok(pTA->cFuncs == 10, "cfuncs %d\n", pTA->cFuncs);
ok(pTA->cImplTypes == 1, "cimpltypes %d\n", pTA->cImplTypes);
ITypeInfo_ReleaseTypeAttr(pTI, pTA);
hr = ITypeInfo_GetRefTypeOfImplType(pTI, 0, &href);
ok(hr == S_OK, "hr %08x\n", hr);
hr = ITypeInfo_GetRefTypeInfo(pTI, href, &pTI_p);
ok(hr == S_OK, "hr %08x\n", hr);
hr = ITypeInfo_GetTypeAttr(pTI_p, &pTA);
ok(IsEqualGUID(&pTA->guid, &IID_IDispatch), "guid {%08x-....\n", pTA->guid.Data1);
ITypeInfo_ReleaseTypeAttr(pTI_p, pTA);
ITypeInfo_Release(pTI_p);
/* Should have ten methods */
hr = ITypeInfo_GetFuncDesc(pTI, 10, &pFD);
ok(hr == TYPE_E_ELEMENTNOTFOUND, "hr %08x\n", hr);
hr = ITypeInfo_GetFuncDesc(pTI, 9, &pFD);
ok(hr == S_OK, "hr %08x\n", hr);
ok(pFD->memid == 0x1236, "memid %08x\n", pFD->memid);
ok(pFD->oVft == 36, "oVft %d\n", pFD->oVft);
ITypeInfo_ReleaseFuncDesc(pTI, pFD);
}
ITypeInfo_Release(pTI);
/* ItestIF2 is an interface which derives from IUnknown */
hr = ITypeLib_GetTypeInfoOfGuid(pTL, &IID_ItestIF2, &pTI);
ok(hr == S_OK, "hr %08x\n", hr);
hr = ITypeInfo_GetTypeAttr(pTI, &pTA);
ok(hr == S_OK, "hr %08x\n", hr);
ok(pTA->typekind == TKIND_INTERFACE, "kind %04x\n", pTA->typekind);
ok(pTA->cbSizeVft == 24, "sizevft %d\n", pTA->cbSizeVft);
ok(pTA->wTypeFlags == 0, "typeflags %x\n", pTA->wTypeFlags);
if(use_midl_tlb) {
ok(pTA->cFuncs == 1, "cfuncs %d\n", pTA->cFuncs);
ok(pTA->cImplTypes == 1, "cimpltypes %d\n", pTA->cImplTypes);
ITypeInfo_ReleaseTypeAttr(pTI, pTA);
/* Should have one method */
hr = ITypeInfo_GetFuncDesc(pTI, 1, &pFD);
ok(hr == TYPE_E_ELEMENTNOTFOUND, "hr %08x\n", hr);
hr = ITypeInfo_GetFuncDesc(pTI, 0, &pFD);
ok(hr == S_OK, "hr %08x\n", hr);
ok(pFD->memid == 0x60020000, "memid %08x\n", pFD->memid);
ok(pFD->oVft == 20, "oVft %d\n", pFD->oVft);
ITypeInfo_ReleaseFuncDesc(pTI, pFD);
}
ITypeInfo_Release(pTI);
ITypeLib_Release(pTL);
return;
}
开发者ID:WASSUM,项目名称:longene_travel,代码行数:101,代码来源:typelib.c
注:本文中的ITypeLib_Release函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论