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
DLL功能是通过名字引出/只有序号,没有任何参数信息。因此,DLL不能导出具有相同名称的重载函数。编译器将不得不装饰导出的名称以使它们唯一。当使用'GetProcAddress()'时,你必须指定那些特定的装饰名称,而不是通用名称被重载。 –