如何在运行时检查运行时是否支持函数GetSystemTimePreciseAsFileTime
?
GetProcAddress
函数来查找函数是否存在,示例如下:typedef void (WINAPI *FuncT) (LPFILETIME lpSystemTimeAsFileTime);
HINSTANCE hDLL = LoadLibrary(L"Kernel32.dll");
FuncT GetSystemTimePreciseAsFileTime = (FuncT) GetProcAddress((HMODULE)hDLL, L"GetSystemTimePreciseAsFileTime");
if (GetSystemTimePreciseAsFileTime)
{
// function is exposed by the DLL, now it can be called
GetSystemTimePreciseAsFileTime(...);
}