setoanocache는 어디에 정의됩니까?
-
23-08-2019 - |
문제
시도 장애를 입히다 BSTR 캐싱 :
SetOaNoCache();
VC ++ 컴파일러 출력을 빌드하십시오:
'SetOaNoCache': identifier not found
하지 않다 사용하고 싶다 :
- Oanocache = 1
의문:
- 어디에 setoanocache 한정된 - 헤더 파일?
해결책
헤더 파일에 정의되지 않으며 eleaut32.dll입니다. 다음과 같이 부를 수 있습니다.
typedef int (*SETOANOCACHE)(void);
void disablebstrcache () {hinstance hlib = loadlibrary ( "eleaut32.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();
}
제휴하지 않습니다 StackOverflow