SetOaNoCache 是在哪里定义的?
-
23-08-2019 - |
题
试图 禁用 BSTR缓存:
SetOaNoCache();
VC++编译器 构建输出:
'SetOaNoCache': identifier not found
不 想要使用:
- 奥诺缓存=1
问题:
- 哪里 设置Oa无缓存 定义的 - 头文件?
解决方案
它没有在头文件中定义,而是在 OLEAUT32.dll 中。你可以这样称呼它:
typedef int (*SETOANOCACHE)(void);
void disablebstrcache(){hinstance hlib = loadLibrary(“ oleaut32.dll”);if(hlib!= null){setoAnocache setoAnocache =(setoAnocache)getProcaddress(hlib,“ setoAnocache”);如果(setoAnocache!= null)setoAnocache();自由库(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();
}
不隶属于 StackOverflow