尝试禁用BSTR 缓存:
SetOaNoCache();
VC++ 编译器构建输出:
'SetOaNoCache': identifier not found
不想使用:
- OANOCACHE=1
问题:
- SetOaNoCache 在哪里定义- 头文件?
尝试禁用BSTR 缓存:
SetOaNoCache();
VC++ 编译器构建输出:
'SetOaNoCache': identifier not found
不想使用:
问题:
它没有在头文件中定义,它在 OLEAUT32.dll 中。你可以这样称呼它:
typedef int (*SETOANOCACHE)(void);
void DisableBSTRCache()
{
HINSTANCE hLib = LoadLibrary("OLEAUT32.DLL");
if (hLib != NULL)
{
SETOANOCACHE SetOaNoCache = (SETOANOCACHE)GetProcAddress(hLib, "SetOaNoCache");
if (SetOaNoCache != NULL)
SetOaNoCache();
FreeLibrary(hLib);
}
}
它不是。从 C++ Builder 附带的 Win32 API 库中:
Requirements
Windows XP: Requires Windows XP Service Pack 2 or later.
Windows 95/98: Not supported.
Header: Not supplied. Declare prototype as shown.
Library: Use oleaut32.lib.
原型如图:
inline void TurnOffCache ()
{
// Function prototype.
extern "C" SetOaNoCache();
// Turn off BSTR caching.
SetOaNoCache();
}