本文整理汇总了C++中IClassFactory_AddRef函数的典型用法代码示例。如果您正苦于以下问题:C++ IClassFactory_AddRef函数的具体用法?C++ IClassFactory_AddRef怎么用?C++ IClassFactory_AddRef使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了IClassFactory_AddRef函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: DllGetClassObject
/***********************************************************************
* DllGetClassObject ([email protected])
*/
HRESULT WINAPI DllGetClassObject(REFCLSID rclsid, REFIID iid, LPVOID *ppv)
{
*ppv = NULL;
if (IsEqualGUID(rclsid,&CLSID_StdFont)) {
if (IsEqualGUID(iid,&IID_IClassFactory)) {
_get_STDFONT_CF(ppv);
IClassFactory_AddRef((IClassFactory*)*ppv);
return S_OK;
}
}
if (IsEqualGUID(rclsid,&CLSID_StdPicture)) {
if (IsEqualGUID(iid,&IID_IClassFactory)) {
_get_STDPIC_CF(ppv);
IClassFactory_AddRef((IClassFactory*)*ppv);
return S_OK;
}
}
if (IsEqualCLSID(rclsid, &CLSID_PSDispatch) && IsEqualIID(iid, &IID_IPSFactoryBuffer)) {
*ppv = &pPSDispatchFacBuf;
IPSFactoryBuffer_AddRef((IPSFactoryBuffer *)*ppv);
return S_OK;
}
if (IsEqualGUID(rclsid,&CLSID_PSOAInterface)) {
if (S_OK==TMARSHAL_DllGetClassObject(rclsid,iid,ppv))
return S_OK;
/*FALLTHROUGH*/
}
if (IsEqualCLSID(rclsid, &CLSID_PSTypeInfo) ||
IsEqualCLSID(rclsid, &CLSID_PSTypeLib) ||
IsEqualCLSID(rclsid, &CLSID_PSDispatch) ||
IsEqualCLSID(rclsid, &CLSID_PSEnumVariant))
return OLEAUTPS_DllGetClassObject(&CLSID_PSFactoryBuffer, iid, ppv);
return OLEAUTPS_DllGetClassObject(rclsid, iid, ppv);
}
示例2: InstanceObjectFactory_Constructor
HRESULT InstanceObjectFactory_Constructor(REFCLSID rclsid, IPropertyBag *pPropertyBag, REFIID riid,
LPVOID *ppvObject)
{
InstanceObjectFactory *pInstanceObjectFactory;
HRESULT hr = E_FAIL;
TRACE("(RegistryPropertyBag=%p, riid=%s, ppvObject=%p)\n", pPropertyBag,
debugstr_guid(riid), ppvObject);
pInstanceObjectFactory = shdocvw_alloc(sizeof(InstanceObjectFactory));
if (pInstanceObjectFactory) {
pInstanceObjectFactory->lpIClassFactoryVtbl = &InstanceObjectFactory_IClassFactoryVtbl;
pInstanceObjectFactory->m_cRef = 0;
memcpy(&pInstanceObjectFactory->m_clsidInstance, rclsid, sizeof(CLSID));
pInstanceObjectFactory->m_pPropertyBag = pPropertyBag;
IPropertyBag_AddRef(pPropertyBag);
IClassFactory_AddRef(STATIC_CAST(IClassFactory, pInstanceObjectFactory));
hr = IClassFactory_QueryInterface(STATIC_CAST(IClassFactory, pInstanceObjectFactory),
riid, ppvObject);
IClassFactory_Release(STATIC_CAST(IClassFactory, pInstanceObjectFactory));
}
return hr;
}
示例3: InstanceObjectFactory_Constructor
static HRESULT InstanceObjectFactory_Constructor(REFCLSID rclsid, IPropertyBag *pPropertyBag,
REFIID riid, LPVOID *ppvObject)
{
InstanceObjectFactory *pInstanceObjectFactory;
HRESULT hr = E_FAIL;
TRACE("(RegistryPropertyBag=%p, riid=%s, ppvObject=%p)\n", pPropertyBag,
debugstr_guid(riid), ppvObject);
pInstanceObjectFactory = heap_alloc(sizeof(InstanceObjectFactory));
if (pInstanceObjectFactory) {
pInstanceObjectFactory->IClassFactory_iface.lpVtbl = &InstanceObjectFactory_IClassFactoryVtbl;
pInstanceObjectFactory->m_cRef = 0;
pInstanceObjectFactory->m_clsidInstance = *rclsid;
pInstanceObjectFactory->m_pPropertyBag = pPropertyBag;
IPropertyBag_AddRef(pPropertyBag);
IClassFactory_AddRef(&pInstanceObjectFactory->IClassFactory_iface);
hr = IClassFactory_QueryInterface(&pInstanceObjectFactory->IClassFactory_iface,
riid, ppvObject);
IClassFactory_Release(&pInstanceObjectFactory->IClassFactory_iface);
}
return hr;
}
示例4: DXDiagCF_QueryInterface
static HRESULT WINAPI DXDiagCF_QueryInterface(IClassFactory *iface, REFIID riid, void **ppv)
{
if (ppv == NULL)
return E_POINTER;
if (IsEqualGUID(&IID_IUnknown, riid))
TRACE("(%p)->(IID_IUnknown %p)\n", iface, ppv);
else if (IsEqualGUID(&IID_IClassFactory, riid))
TRACE("(%p)->(IID_IClassFactory %p)\n", iface, ppv);
else if (IsEqualGUID(&IID_IExternalConnection, riid) ||
IsEqualGUID(&IID_IMarshal, riid)) {
TRACE("(%p)->(%s) ignoring\n", iface, debugstr_guid(riid));
*ppv = NULL;
return E_NOINTERFACE;
}
else {
FIXME("(%p)->(%s %p)\n", iface, debugstr_guid(riid), ppv);
*ppv = NULL;
return E_NOINTERFACE;
}
*ppv = iface;
IClassFactory_AddRef(iface);
return S_OK;
}
示例5: DllGetClassObject
/******************************************************************
* DllGetClassObject ([email protected])
*
*
*/
HRESULT WINAPI DllGetClassObject(REFCLSID rclsid, REFIID riid, LPVOID *ppv)
{
TRACE("(%s, %s, %p)\n", debugstr_dmguid(rclsid), debugstr_dmguid(riid), ppv);
if (IsEqualCLSID(rclsid, &CLSID_DirectMusicSynth) && IsEqualIID(riid, &IID_IClassFactory)) {
*ppv = &Synth_CF;
IClassFactory_AddRef((IClassFactory*)*ppv);
return S_OK;
} else if (IsEqualCLSID(rclsid, &CLSID_DirectMusicSynthSink) && IsEqualIID(riid, &IID_IClassFactory)) {
*ppv = &SynthSink_CF;
IClassFactory_AddRef((IClassFactory*)*ppv);
return S_OK;
}
WARN("(%s,%s,%p): no interface found.\n", debugstr_dmguid(rclsid), debugstr_dmguid(riid), ppv);
return CLASS_E_CLASSNOTAVAILABLE;
}
示例6: ClassMonikerCF_QueryInterface
static HRESULT WINAPI ClassMonikerCF_QueryInterface(IClassFactory *iface, REFIID riid, void **ppv)
{
*ppv = NULL;
if (IsEqualIID(riid, &IID_IUnknown) || IsEqualIID(riid, &IID_IClassFactory))
{
*ppv = iface;
IClassFactory_AddRef(iface);
return S_OK;
}
return E_NOINTERFACE;
}
示例7: IMAPTransportCF_QueryInterface
static HRESULT WINAPI IMAPTransportCF_QueryInterface(IClassFactory *iface,
REFIID riid, LPVOID *ppv)
{
*ppv = NULL;
if (IsEqualIID(riid, &IID_IUnknown) || IsEqualIID(riid, &IID_IClassFactory))
{
*ppv = iface;
IClassFactory_AddRef(iface);
return S_OK;
}
return E_NOINTERFACE;
}
示例8: wucf_QueryInterface
static HRESULT WINAPI wucf_QueryInterface( IClassFactory *iface, REFIID riid, LPVOID *ppobj )
{
if (IsEqualGUID(riid, &IID_IUnknown) ||
IsEqualGUID(riid, &IID_IClassFactory))
{
IClassFactory_AddRef( iface );
*ppobj = iface;
return S_OK;
}
FIXME("interface %s not implemented\n", debugstr_guid(riid));
return E_NOINTERFACE;
}
示例9: RegistrarCF_QueryInterface
static HRESULT WINAPI RegistrarCF_QueryInterface(IClassFactory *iface, REFIID riid, void **ppvObject)
{
TRACE("(%p)->(%s %p)\n", iface, debugstr_guid(riid), ppvObject);
if(IsEqualGUID(&IID_IUnknown, riid) || IsEqualGUID(&IID_IClassFactory, riid)) {
*ppvObject = iface;
IClassFactory_AddRef( iface );
return S_OK;
}
return E_NOINTERFACE;
}
示例10: FileMonikerCF_QueryInterface
static HRESULT WINAPI FileMonikerCF_QueryInterface(LPCLASSFACTORY iface,
REFIID riid, LPVOID *ppv)
{
*ppv = NULL;
if (IsEqualIID(riid, &IID_IUnknown) || IsEqualIID(riid, &IID_IClassFactory))
{
*ppv = iface;
IClassFactory_AddRef(iface);
return S_OK;
}
return E_NOINTERFACE;
}
示例11: ClassFactory_QueryInterface
static HRESULT WINAPI ClassFactory_QueryInterface(IClassFactory *iface, REFGUID riid, void **ppvObject)
{
if(IsEqualGUID(&IID_IClassFactory, riid) || IsEqualGUID(&IID_IUnknown, riid)) {
IClassFactory_AddRef(iface);
*ppvObject = iface;
return S_OK;
}
WARN("not supported iid %s\n", debugstr_guid(riid));
*ppvObject = NULL;
return E_NOINTERFACE;
}
示例12: ClassFactory_QueryInterface
static HRESULT WINAPI ClassFactory_QueryInterface(IClassFactory *iface, REFIID riid, LPVOID *ppvOut)
{
*ppvOut = NULL;
if (IsEqualIID(riid, &IID_IClassFactory) || IsEqualIID(riid, &IID_IUnknown)) {
IClassFactory_AddRef(iface);
*ppvOut = iface;
return S_OK;
}
WARN("Unknown interface %s\n", debugstr_guid(riid));
return E_NOINTERFACE;
}
示例13: OBJSEL_IClassFactory_LockServer
/**********************************************************************
* OBJSEL_IClassFactory_LockServer
*/
static HRESULT WINAPI OBJSEL_IClassFactory_LockServer(
LPCLASSFACTORY iface,
BOOL fLock)
{
TRACE("\n");
if (fLock)
IClassFactory_AddRef(iface);
else
IClassFactory_Release(iface);
return S_OK;
}
示例14: MSTASK_IClassFactory_LockServer
static HRESULT WINAPI MSTASK_IClassFactory_LockServer(
IClassFactory *iface,
BOOL fLock)
{
TRACE("\n");
if (fLock)
IClassFactory_AddRef(iface);
else
IClassFactory_Release(iface);
return S_OK;
}
示例15: DllGetClassObject
/***********************************************************************
* DllGetClassObject ([email protected])
*/
HRESULT WINAPI DllGetClassObject(REFCLSID rclsid, REFIID riid, LPVOID *ppv)
{
TRACE("(%s,%s,%p)\n", debugstr_guid(rclsid), debugstr_guid(riid), ppv);
if ( IsEqualCLSID( &IID_IClassFactory, riid ) ) {
*ppv = &DINPUT8_CF;
IClassFactory_AddRef((IClassFactory*)*ppv);
return S_OK;
}
FIXME("(%s,%s,%p): no interface found.\n", debugstr_guid(rclsid), debugstr_guid(riid), ppv);
return CLASS_E_CLASSNOTAVAILABLE;
}