문제

시도 장애를 입히다 BSTR 캐싱 :

SetOaNoCache();

VC ++ 컴파일러 출력을 빌드하십시오:

  • 'SetOaNoCache': identifier not found

하지 않다 사용하고 싶다 :

  • Oanocache = 1

의문:

도움이 되었습니까?

해결책

헤더 파일에 정의되지 않으며 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();
}
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top