问题
I'm trying to use the IAppVisibility interface (and namely the IAppVisibility::GetAppVisibilityOnMonitor method) from my C++ project that is developed under Visual Studio 2008. I found this code sample, that unfortunately requires VS 2012 to compile.
So I was curious, is there a way to call it from a VS project prior to VS 2012?
For instance, I'm doing this:
#include <Shobjidl.h> //Earlier version
IAppVisibility* pAppVis = NULL;
HRESULT hr = CoCreateInstance(CLSID_AppVisibility, NULL, CLSCTX_INPROC_SERVER,
IID_IAppVisibility, (void**) &pAppVis);
That results in the following errors:
error C2065: 'IAppVisibility' : undeclared identifier
error C2065: 'IID_IAppVisibility' : undeclared identifier
来源:https://stackoverflow.com/questions/23207291/how-to-use-iappvisibility-from-a-vs-project-prior-to-vs-2012