COM Class Factories

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

COM Class Factories

Udo Schneider
I created a COM Component. I registerd the component and it's class factory.
Right now
this component doesn't implement any interfaces (except IUnknown and
IDispatch).

If I try to access this component, the Image is started and the call fails.
I think COM isn't able
to create the component using the Class Factory because even a "self halt"
in the queryInerface method
doesn't bring up the wallback window.

Even if the image is allready running it gets started again. This means it
can't be a timeout problem for
creating the Class Factories when the image is started.

Any hints?

Thanks,

Udo


Reply | Threaded
Open this post in threaded view
|

Re: COM Class Factories

Blair McGlashan
Udo

You wrote in message news:9udjbg$7oljb$[hidden email]...
> I created a COM Component. I registerd the component and it's class
factory.
> Right now
> this component doesn't implement any interfaces (except IUnknown and
> IDispatch).
>
> If I try to access this component, the Image is started and the call
fails.
> I think COM isn't able
> to create the component using the Class Factory because even a "self halt"
> in the queryInerface method
> doesn't bring up the wallback window.

Try setting a breakpoint in some of the class factory framework code, .e.g.
in COMClassFactory>>CreateInstance:riid:ppvObject:
Remember that Dolphin doesn't implement any of its basic COM framework in
the VM at all - it is all implemented in Smalltalk, and therefore you can
debug through any of it.

>
> Even if the image is allready running it gets started again. This means it
> can't be a timeout problem for
> creating the Class Factories when the image is started.

Actually that would suggest that although the COMponent is correctly
registered (in that it has entries in the system registry database), that
the image is not "registering" (in a different way) the class factory when
it starts. If a running executable has registered a class factory for a
COMponent then COM does not need to start up a server so if you have
registered a class factory in your development image and that image is
running, then it should be used to service requests for the component. Try
sending #registerClassFactory to your COMInterfaceImp subclass (if you
haven't already). The 'Factories' class variable of COMClassFactory should
contain an entry for your class, and the CLSID must obviously be correct.

Regards

Blair


Reply | Threaded
Open this post in threaded view
|

Re: COM Class Factories

Udo Schneider
Blair,

thanks for the hint. I finally found the problem ... although the cause was
different.

I added a break point as you proposed by nothing happened at all! The image
was started (again) and failed.
Then I tried the same package with a fresh image and everything was fine. I
think I messed up my previos image
a little bit.

BTW: The fact that the whole COM stuff is implemented in Dolphin is really
amazing. With a little background
knowledge from "Inside COM" and "Inside ActiveX&OLE" it's really amazing to
see how COM can be implemented
in a non C/C++ way.

Thanks for your support,

Udo

"Blair McGlashan" <[hidden email]> schrieb im Newsbeitrag
news:9ug5pe$8752r$[hidden email]...

> Udo
>
> You wrote in message news:9udjbg$7oljb$[hidden email]...
> > I created a COM Component. I registerd the component and it's class
> factory.
> > Right now
> > this component doesn't implement any interfaces (except IUnknown and
> > IDispatch).
> >
> > If I try to access this component, the Image is started and the call
> fails.
> > I think COM isn't able
> > to create the component using the Class Factory because even a "self
halt"
> > in the queryInerface method
> > doesn't bring up the wallback window.
>
> Try setting a breakpoint in some of the class factory framework code,
.e.g.
> in COMClassFactory>>CreateInstance:riid:ppvObject:
> Remember that Dolphin doesn't implement any of its basic COM framework in
> the VM at all - it is all implemented in Smalltalk, and therefore you can
> debug through any of it.
>
> >
> > Even if the image is allready running it gets started again. This means
it

> > can't be a timeout problem for
> > creating the Class Factories when the image is started.
>
> Actually that would suggest that although the COMponent is correctly
> registered (in that it has entries in the system registry database), that
> the image is not "registering" (in a different way) the class factory when
> it starts. If a running executable has registered a class factory for a
> COMponent then COM does not need to start up a server so if you have
> registered a class factory in your development image and that image is
> running, then it should be used to service requests for the component. Try
> sending #registerClassFactory to your COMInterfaceImp subclass (if you
> haven't already). The 'Factories' class variable of COMClassFactory should
> contain an entry for your class, and the CLSID must obviously be correct.
>
> Regards
>
> Blair
>
>
>