本文整理汇总了C++中ITypeLib_Release函数的典型用法代码示例。如果您正苦于以下问题:C++ ITypeLib_Release函数的具体用法?C++ ITypeLib_Release怎么用?C++ ITypeLib_Release使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了ITypeLib_Release函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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);
}