How to use IAppVisibility from a VS project prior to VS 2012?

痴心易碎 提交于 2019-12-11 20:44:13

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!