DLL 中的函数是最通用的一个,D2D1CreateFactory(D2D1_FACTORY_TYPE,REFIID,D2D1_FACTORY_OPTIONS*,void**) function
. 如果您查看 中的声明d2d1.h
,您会看到该函数已声明,而其他重载只是标题中的内联函数,它们调用通用函数:
#ifndef D2D_USE_C_DEFINITIONS
inline
HRESULT
D2D1CreateFactory(
__in D2D1_FACTORY_TYPE factoryType,
__in REFIID riid,
__out void **factory
)
{
return
D2D1CreateFactory(
factoryType,
riid,
NULL,
factory);
}
template<class Factory>
HRESULT
D2D1CreateFactory(
__in D2D1_FACTORY_TYPE factoryType,
__out Factory **factory
)
{
return
D2D1CreateFactory(
factoryType,
__uuidof(Factory),
reinterpret_cast<void **>(factory));
}
template<class Factory>
HRESULT
D2D1CreateFactory(
__in D2D1_FACTORY_TYPE factoryType,
__in CONST D2D1_FACTORY_OPTIONS &factoryOptions,
__out Factory **ppFactory
)
{
return
D2D1CreateFactory(
factoryType,
__uuidof(Factory),
&factoryOptions,
reinterpret_cast<void **>(ppFactory));
}
#endif // #ifndef D2D_USE_C_DEFINITIONS