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, 27 Aug 2007 14:45:02 -0300,    group: microsoft.public.platformsdk.com_ole        back       


How to retrieve object instance from a specific instance of server   
Hi
I have two activex based services. Server1 and its client Server2 (which is 
an activex server too).
Server2 creates an object instance which is in Server1. The fact is my boss 
asked me to make those servers multi instance on the same machine, so that 
it allows Two or mor instances of Server2 comunicating with their respective 
Server1 instance. How do I do that? Is this even posible?
date: Mon, 27 Aug 2007 14:45:02 -0300   author:   Diego L Espi?eira

Re: How to retrieve object instance from a specific instance of server   
Diego L Espieira  wrote:
> I have two activex based services. Server1 and its client Server2
> (which is an activex server too).
> Server2 creates an object instance which is in Server1. The fact is
> my boss asked me to make those servers multi instance on the same
> machine, so that it allows Two or mor instances of Server2
> comunicating with their respective Server1 instance. How do I do
> that? Is this even posible?

I'm not sure I understand the question. Anyway, be aware that you can 
pass REGCLS_SINGLEUSE flag to CoRegisterClassObject, in which case a new 
server process will run for every CoCreateInstance call the client 
makes. Each process will serve only one instance of the COM object.
-- 
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, 27 Aug 2007 13:56:34 -0400   author:   Igor Tandetnik

Re: How to retrieve object instance from a specific instance of server   
I dont want the servers to be started when an instance of a given interface 
is requested. I'm using COM as an inter process mechanism. The servers are 
already started and clients "connect" to Event Sinks by requesting the 
server for an instance of a class. The problem I have is that I dont know 
how to make a client choose a specific instance (PID?) of the running 
servers to request to for that object.
Ej.
I have...
ServerA is running, then ClientA starts and requests an instance of a class 
provided by ServerA
(ServerA <- ClientA)

I whant...
ServerA1 and ServerA2 are running (both are instances of ServerA, ej. 
ServerA.exe)
Then ClientA1 and ClientA2 are launched (both are instances of ClientA, ej. 
ClientA.exe)
So I need to be able to specify that ClientA1 must request an instance of 
that object only to ServerA1 and not to ServerA2. Therefore ServerA1 <- 
ClientA1 and ServerA2 <- ClientA2.

Am I explaining thing clearly?

Thanks for your reply





"Igor Tandetnik"  wrote in message 
news:etYSRTN6HHA.2208@TK2MSFTNGP06.phx.gbl...
> Diego L Espieira  wrote:
>> I have two activex based services. Server1 and its client Server2
>> (which is an activex server too).
>> Server2 creates an object instance which is in Server1. The fact is
>> my boss asked me to make those servers multi instance on the same
>> machine, so that it allows Two or mor instances of Server2
>> comunicating with their respective Server1 instance. How do I do
>> that? Is this even posible?
>
> I'm not sure I understand the question. Anyway, be aware that you can pass 
> REGCLS_SINGLEUSE flag to CoRegisterClassObject, in which case a new server 
> process will run for every CoCreateInstance call the client makes. Each 
> process will serve only one instance of the COM object.
> -- 
> 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, 27 Aug 2007 16:52:42 -0300   author:   Diego L Espi?eira

Re: How to retrieve object instance from a specific instance of server   
Diego L Espieira  wrote:
> I dont want the servers to be started when an instance of a given
> interface is requested. I'm using COM as an inter process mechanism.
> The servers are already started and clients "connect" to Event Sinks
> by requesting the server for an instance of a class. The problem I
> have is that I dont know how to make a client choose a specific
> instance (PID?) of the running servers to request to for that object.

Register each server in the ROT (IRunningObjectTable), e.g. using an 
item moniker (CreateItemMoniker) with some kind of naming convention 
that would allow you to distinguish between server instances. Clients 
can then retrieve specific objects by name, either with 
IRunningObjectTable::GetObject or with IMoniker::BindToObject.
-- 
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, 27 Aug 2007 16:57:48 -0400   author:   Igor Tandetnik

Re: How to retrieve object instance from a specific instance of server   
Thanks for the information!!!!!!
You really saved my ass!!

"Igor Tandetnik"  wrote in message 
news:OdA9tzO6HHA.1184@TK2MSFTNGP04.phx.gbl...
> Diego L Espieira  wrote:
>> I dont want the servers to be started when an instance of a given
>> interface is requested. I'm using COM as an inter process mechanism.
>> The servers are already started and clients "connect" to Event Sinks
>> by requesting the server for an instance of a class. The problem I
>> have is that I dont know how to make a client choose a specific
>> instance (PID?) of the running servers to request to for that object.
>
> Register each server in the ROT (IRunningObjectTable), e.g. using an item 
> moniker (CreateItemMoniker) with some kind of naming convention that would 
> allow you to distinguish between server instances. Clients can then 
> retrieve specific objects by name, either with 
> IRunningObjectTable::GetObject or with IMoniker::BindToObject.
> -- 
> 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, 27 Aug 2007 18:27:46 -0300   author:   Diego L Espi?eira

Google
 
Web ureader.com


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