试图 禁用 BSTR缓存:

SetOaNoCache();

VC++编译器 构建输出:

  • 'SetOaNoCache': identifier not found

想要使用:

  • 奥诺缓存=1

问题:

有帮助吗?

解决方案

它没有在头文件中定义,而是在 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();
}
许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top