I have a small unmanaged c++ application, I'm trying to use CoCreateInstance(...) to create an instance of the "Adobe SVG PLayer" which is installed as an ActiveX control.
When I compile and run my application under 32-bit configuration, it works fine, but when I compile under 64-bit configuration, my application fails to create the instance of the Adove SVG Player, although I know it is installed.
This is the code that I'm using for doing this:
const CLSID CLSID_SVGCtl =
{0x377b5106,0x3b4e,0x4a2d,{0x85,0x20,0x87,0x67,0x59,0x0c,0xac,0x86}};
BOO开发者_如何学编程L CheckSVGPresented()
{
BOOL bResult = FALSE;
try
{
IUnknown* pSvgCtrl = NULL;
if (FAILED(::CoCreateInstance(CLSID_SVGCtl, NULL, CLSCTX_INPROC_SERVER, IID_IUnknown, (LPVOID*)&pSvgCtrl)) || (NULL == pSvgCtrl))
throw 1;
bResult = TRUE;
pSvgCtrl->Release();
}
catch (...)
{
bResult = FALSE;
}
return bResult;
}
My guess is that probably I have an issue because I have a 64 bits host (my application) trying to create a 32-bits instance of an ActiveX dll (The SVG player).
I'm testing on Windows 7, x64 bits version.
So if you have any clue about this I will appreciate the help.
I'm assuming that the ActiveX DLL you are trying to load is 32-bit only. Since ActiveX components are typically InProc, and 64 bit apps can't load in 32 bit DLLs, then you are correct about your guess.
http://thermous.spaces.live.com/blog/cns!8DC85127F8CE2F12!161.entry
精彩评论