Saturday, 17 August 2013

error LNK2001: unresolved external symbol CATID_AppContainerCompatible

error LNK2001: unresolved external symbol CATID_AppContainerCompatible

I am trying to register BHO with APPcontainer.Now as per the blog
http://blogs.msdn.com/b/ieinternals/archive/2012/03/23/understanding-ie10-enhanced-protected-mode-network-security-addons-cookies-metro-desktop.aspx
,I
have defined following in same cpp file as DLLRegister
DEFINE_GUID(CATID_AppContainerCompatible,
0x59fb2056,0xd625,0x48d0,0xa9,0x44,0x1a,0x85,0xb5,0xab,0x26,0x40);
STDAPI DllRegisterServer(void)
{
// let ATL handle this
HRESULT hr = _AtlModule.DllRegisterServer();
ICatRegister* pcr = NULL ;
hr = CoCreateInstance(CLSID_StdComponentCategoriesMgr, NULL,
CLSCTX_INPROC_SERVER, IID_ICatRegister, (void**)&pcr);
if (FAILED(hr))
return hr;
if (SUCCEEDED(hr))
{
// Register this category as being "implemented" by
// the class.
CATID rgcatid[1] ;
rgcatid[0] = CATID_AppContainerCompatible;
hr = pcr->RegisterClassImplCategories(CLSID_ABC, 1, rgcatid);
}
When I try to compile this code I am getting following error:
unresolved external symbol CATID_AppContainerCompatible
Not sure why this is coming. I can navigate to
CATID_AppContainerCompatible definition by right click on it. any
suggesitons??
I solved the issue. since DEFINE_GUID declares GUID as extern I need to
put const GUID CATID_AppContainerCompatible ; in my file .After putting
that statement its compiling.

No comments:

Post a Comment