|
|
|
date: Mon, 20 Aug 2007 15:58:16 -0400,
group: microsoft.public.platformsdk.com_ole
back
Re: ie can create a COM object, but i cannot?
Ian Boyd wrote:
> i've stolen the code from ra.microsoft.com, where Microsoft uses local
> ActiveX+javascript to program remote assistance to connect back to
> Microsoft, so they can assist you.
>
> If you put the following in an HTML file and open it, it loads without
> incident.
>
> <HTML>
> <HEAD>
> <OBJECT ID=PCHealth
> CLASSID="clsid:FC7D9E02-3F9E-11d3-93C0-00C04F72DAF7"
>> </OBJECT>
> <body>
> </body>
> </BODY>
> </HTML>
>
>
> But if i try to create the object (in pascal):
>
> CLASS_PCHBootstrapper = '{FC7D9E02-3F9E-11D3-93C0-00C04F72DAF7}';
> hr = CoCreateInstance(
> CLASS_PCHBootstrapper,
> null,
> CLSCTX_INPROC_SERVER || CLSCTX_LOCAL_SERVER,
> IID_IUnknown, unk);
>
> i get the error $800401F9 Error in the DLL
>
>
> How is ie able to create a COM object when i cannot?
I suspect the object checks in DllMain which process is loading it, and
returns failure if it's not, say, Internet Explorer. See also
GetModuleFileName.
--
With best wishes,
Igor Tandetnik
With sufficient thrust, pigs fly just fine. However, this is not
necessarily a good idea. It is hard to be sure where they are going to
land, and it could be dangerous sitting under them as they fly
overhead. -- RFC 1925
date: Mon, 20 Aug 2007 16:09:04 -0400
author: Igor Tandetnik
Re: ie can create a COM object, but i cannot?
Ian Boyd wrote:
>> I suspect the object checks in DllMain which process is loading it,
>> and returns failure if it's not, say, Internet Explorer. See also
>> GetModuleFileName.
>
> i tried building my exe as iexplore.exe and putting it in
>
> %ProgramFiles%\Internet Explorer\iexplore.exe
>
> and it didn't work.
>
>
> You think that Microsoft would be vindictive enough to sabotage people
> trying to use their poorly documented components?
> http://msdn2.microsoft.com/en-us/library/aa373036.aspx
Upon further checking, it's incorrectly registered. The server is
C:\WINDOWS\PCHealth\HelpCtr\Binaries\HelpCtr.exe
but it's listed under InprocServer32 instead of LocalServer32.
CoCreateInstance tries to LoadLibrary it, and of course fails.
How IE manages to create it (if indeed it does - I haven't verified it)
I have no idea.
--
With best wishes,
Igor Tandetnik
With sufficient thrust, pigs fly just fine. However, this is not
necessarily a good idea. It is hard to be sure where they are going to
land, and it could be dangerous sitting under them as they fly
overhead. -- RFC 1925
date: Mon, 20 Aug 2007 17:11:22 -0400
author: Igor Tandetnik
|
|