Basic questions about CLSCTX enum, inproc and out-of-proc servers 
Author Message
 Basic questions about CLSCTX enum, inproc and out-of-proc servers

I am confused with the use of CLSCTX_INPROC_SERVER and CLSCTX_LOCAL_SERVER.
I am sure that these are quite basic questions, so I hope that someone can
help me!

What if I have a COM EXE server that implements two coclasses, and one
contains a collection of interfaces implemented in the another? I cannot use
CLSCTX_INPROC_SERVER when calling CoCreateInstance, so all the objects will
live in separate processes.
What if I want to aggregate an interface implemented in one coclass from the
other coclass? interfaces from out-of-proc objects cannot be aggregated.

Is there any way of having two objects of a out-of-proc server living in the
same process as the objects in an inproc server do? Do I have to implement
the contained/aggregated classes in a separate DLL in order to be able to
use CLSCTX_INPROC_SERVER?

Many thanks in advance!

Jorge.



Mon, 24 Oct 2005 23:13:17 GMT  
 Basic questions about CLSCTX enum, inproc and out-of-proc servers
You should be able to create the aggregatee with
CoCreateInstance(CLSCTX_INPROC_SERVER) and it should work. By default,
ATL calls CoRegisterClassObject with REGCLS_MULTIPLEUSE flag, which
automatically registers the same class factory both for
CLSCTX_INPROC_SERVER and CLSCTX_LOCAL_SERVER contexts.
--
With best wishes,
    Igor Tandetnik

"For every complex problem, there is a solution that is simple, neat,
and wrong." H.L. Mencken


Quote:
> I am confused with the use of CLSCTX_INPROC_SERVER and

CLSCTX_LOCAL_SERVER.
Quote:
> I am sure that these are quite basic questions, so I hope that someone
can
> help me!

> What if I have a COM EXE server that implements two coclasses, and one
> contains a collection of interfaces implemented in the another? I
cannot use
> CLSCTX_INPROC_SERVER when calling CoCreateInstance, so all the objects
will
> live in separate processes.
> What if I want to aggregate an interface implemented in one coclass
from the
> other coclass? interfaces from out-of-proc objects cannot be
aggregated.

> Is there any way of having two objects of a out-of-proc server living
in the
> same process as the objects in an inproc server do? Do I have to
implement
> the contained/aggregated classes in a separate DLL in order to be able
to
> use CLSCTX_INPROC_SERVER?



Mon, 24 Oct 2005 23:21:56 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. COM, inproc servers, etc: a novice question

2. Starting an inproc server as a local server using a DLL Surrogate

3. Basic enum question.

4. Converting In-Proc Server to out-Proce Server?

5. registering ATL inproc server

6. InProc Server (Marshalling problem)

7. problem with CreateThread in the InProc server.

8. Inproc Server loading Java HotSpot DLL

9. Registering in the ROT an ActiveX object implemented in an inproc server

10. Remote Debugging An Inproc Server

11. * export enums from ATL inproc server to clients

12. Quesion on Loadlibrary in an Inproc Server...

 

 
Powered by phpBB® Forum Software