Aaron
Aaron

Reputation: 2883

Where is SetOaNoCache defined?

Attempting to disable BSTR caching:

SetOaNoCache();

VC++ compiler build output:

Don't want to use:

Question:

Upvotes: 4

Views: 2209

Answers (2)

Ken White
Ken White

Reputation: 125748

It's not. From the Win32 API library shipped with C++ Builder:

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.

The prototype as shown:

inline void TurnOffCache ()
{
// Function prototype.
extern "C" SetOaNoCache(); 
// Turn off BSTR caching.
SetOaNoCache();
}

Upvotes: 3

Patrick Glandien
Patrick Glandien

Reputation: 7851

It is not defined in a header file, it is in OLEAUT32.dll. You can call it like this:

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); } }

Upvotes: 8

Related Questions