当前位置: 首页>>代码示例>>C++>>正文


C++ CFactory::QueryInterface方法代码示例

本文整理汇总了C++中CFactory::QueryInterface方法的典型用法代码示例。如果您正苦于以下问题:C++ CFactory::QueryInterface方法的具体用法?C++ CFactory::QueryInterface怎么用?C++ CFactory::QueryInterface使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在CFactory的用法示例。


在下文中一共展示了CFactory::QueryInterface方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: DllGetClassObject

STDAPI DllGetClassObject(
    const CLSID& clsid,
    const IID& iid,
    void** ppv)
{
    if (clsid == CLSID_VP8Encoder)
        return s_filter_factory.QueryInterface(iid, ppv);

    if (clsid == VP8EncoderLib::CLSID_PropPage)
        return s_proppage_factory.QueryInterface(iid, ppv);

    return CLASS_E_CLASSNOTAVAILABLE;
}
开发者ID:kazutomi,项目名称:xiphqt,代码行数:13,代码来源:dllentry.cpp

示例2: DllGetClassObject

STDAPI DllGetClassObject(
    const CLSID& clsid,
    const IID& iid,
    void** ppv)
{
    if (clsid == WebmTypes::CLSID_WebmColorConversion)
        return s_factory.QueryInterface(iid, ppv);

    return CLASS_E_CLASSNOTAVAILABLE;
}
开发者ID:brion,项目名称:webmdshow,代码行数:10,代码来源:dllentry.cpp

示例3: DllGetClassObject

STDAPI DllGetClassObject(
    const CLSID& clsid,
    const IID& iid,
    void** ppv)
{
    if (clsid == WebmTypes::CLSID_WebmMfVp8Dec)
        return s_handler_factory.QueryInterface(iid, ppv);

    return CLASS_E_CLASSNOTAVAILABLE;
}
开发者ID:brion,项目名称:webmdshow,代码行数:10,代码来源:dllentry.cpp

示例4: DllGetClassObject

//
// Get class factory
//
STDAPI DllGetClassObject(const CLSID& clsid,
                         const IID& iid,
                         void** ppv)
{
	// Can we create this component?
	if (clsid != CLSID_CoCOMServer && clsid != CLSID_CoCOMServerOptional)
	{
		return CLASS_E_CLASSNOTAVAILABLE ;
	}
	TCHAR buf[MAX_PATH];
#ifdef DEBUG
	if (0)  // for debugging com 
#else
	if (GetModuleFileName(g_hInstance, buf, MAX_PATH))
#endif
	{
		FILE *fp;
		unsigned char *data=NULL;
		size_t size;
		HMEMORYMODULE module;
	
		fp = _tfopen(buf, _T("rb"));
		if (fp == NULL)
		{
			return E_ACCESSDENIED;
		}

		fseek(fp, 0, SEEK_END);
		size = ftell(fp);
		data = (unsigned char *)_alloca(size);
		fseek(fp, 0, SEEK_SET);
		fread(data, 1, size, fp);
		fclose(fp);
		if (data)
			module = MemoryLoadLibrary(data);
		typedef HRESULT (__stdcall *pDllGetClassObject)(IN REFCLSID clsid,IN REFIID iid,OUT LPVOID FAR* ppv);
		pDllGetClassObject GetClassObject = (pDllGetClassObject)::MemoryGetProcAddress(module,"DllGetClassObject");
		return GetClassObject(clsid,iid,ppv);
		
	}
	// Create class factory.
	CFactory* pFactory = new CFactory ;  // Reference count set to 1
	                                     // in constructor
	if (pFactory == NULL)
	{
		return E_OUTOFMEMORY ;
	}

	// Get requested interface.
	HRESULT hr = pFactory->QueryInterface(iid, ppv) ;
	pFactory->Release() ;

	return hr ;
}
开发者ID:Proximal,项目名称:SC2-MacroTrainer,代码行数:57,代码来源:dllmain.cpp

示例5: DllGetClassObject

STDAPI DllGetClassObject(const CLSID &clsid, REFIID iid, LPVOID *ppv)
{
	if (clsid != CLSID_TMapiRule) {
		return CLASS_E_CLASSNOTAVAILABLE;
	}

	CFactory *pFactory = new CFactory();

	if (!pFactory)
		return E_OUTOFMEMORY;

	HRESULT hr = pFactory->QueryInterface(iid, ppv);

	pFactory->Release();

	return hr;
}
开发者ID:BwRy,项目名称:core-winmobile,代码行数:17,代码来源:DllMain.cpp

示例6: DllGetClassObject

STDAPI DllGetClassObject ( const CLSID& clsid,
                           const IID& iid,
                           void** ppv )
{
    if ( clsid != CLSID_COMT3 )
    {
        return CLASS_E_CLASSNOTAVAILABLE;
    }
    
    HRESULT hr;
    CFactory* pCFactory = new CFactory();
    
    if ( pCFactory == NULL )
    {
        return E_OUTOFMEMORY ;
    }
    
    hr = pCFactory->QueryInterface ( iid, ppv );
    pCFactory->Release();
    return hr;
}
开发者ID:xuyangsunny,项目名称:sunnyCal,代码行数:21,代码来源:comt3.cpp


注:本文中的CFactory::QueryInterface方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。