Ureader.com  
Microsoft software help and Community
   home   |   control panel login   |   archive   |  
 
platform
active.directory
adsi
adsi.iis-admin
base
com_ole
complus_mts
component_svcs
database
directx
gdi
graphics_mm
internet.client
internet.server
internet.server.isapi-dev
localization
mapi
messaging
msi
mslayerforunicode
multimedia
networking
networking.ipv6
sdk_install
security
shell
telephony.tapi_2
telephony.tapi_3
telephony.tsp
telephony.wte
tools
ui
ui_shell
win_base_svcs
win16
  
 
date: Mon, 20 Aug 2007 15:58:16 -0400,    group: microsoft.public.platformsdk.com_ole        back       


ie can create a COM object, but i cannot?   
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?
date: Mon, 20 Aug 2007 15:58:16 -0400   author:   Ian Boyd

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?   
> 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

i would hope it's something to do with the threading model my initialized 
apartment.
date: Mon, 20 Aug 2007 16:47:32 -0400   author:   Ian Boyd

Re: ie can create a COM object, but 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.

They even give us a type library, with dispinterfaces. Why would they do 
that if they didn't want us to linking to it?
date: Mon, 20 Aug 2007 16:51:33 -0400   author:   Ian Boyd

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

Google
 
Web ureader.com


    COPYRIGHT 2007, YARDI TECHNOLOGY LIMITED, ALL RIGHT RESERVE  |   contact us