试图禁用 BSTR缓存:
SetOaNoCache();
VC++编译器构建输出:
'SetOaNoCache': identifier not found
不要想用:
OANOCACHE = 1
题:
SetOaNoCache 在哪里定义 - 头文件?
Patrick Glan.. 7
它没有在头文件中定义,它在OLEAUT32.dll中.你可以这样称呼它:
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); } }
它没有在头文件中定义,它在OLEAUT32.dll中.你可以这样称呼它:
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); } }