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, 28 Nov 2005 15:51:34 +0700,    group: microsoft.public.platformsdk.com_ole        back       


RPC server is unavailable   
Hi all,

I have a COM exe which was declare as a windows service, a COM dll, and a 
Client.

The server have contain an interface of COM dll
and it has two methods GetObject and SetObject for getting and setting this 
variable.

Everything is OK with Get and Set method
But
When client call GetObject to get object from server, then store it to a 
member variable of client. Then stop the server, start it again. When the 
client call SetObject and pass the variable store above to server. I got 
exception The RPC server is unavailable.

What have i done wrong?

Hieu Le
date: Mon, 28 Nov 2005 15:51:34 +0700   author:   Hieu Le Trung

Re: RPC server is unavailable   
"Hieu Le Trung"  wrote in message
news:e4e4Bk$8FHA.2364@TK2MSFTNGP12.phx.gbl
> I have a COM exe which was declare as a windows service, a COM dll,
> and a Client.
>
> The server have contain an interface of COM dll
> and it has two methods GetObject and SetObject for getting and
> setting this variable.
>
> Everything is OK with Get and Set method
> But
> When client call GetObject to get object from server, then store it
> to a member variable of client. Then stop the server, start it again.
> When the client call SetObject and pass the variable store above to
> server. I got exception The RPC server is unavailable.

Who loads the DLL? In other words, who calls CoCreateInstance to create 
an instance of the in-proc object that then gets passed around? Be aware 
that an in-proc object cannot possibly outlive the process it is created 
in. It sounds like that process gets terminated in your case.
-- 
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, 28 Nov 2005 08:26:04 -0500   author:   Igor Tandetnik

Re: RPC server is unavailable   
Thanks

I know now, that because of the server create the interface (in proc) then 
pass to client.
And so when the server stop, that interface is being destroy also.
My solution is create an instance of that interface in client and make copy 
all data from the interface pass from server.

Is there any other ways instead of this one?

Regards

Hieu Le

"Igor Tandetnik"  wrote in message 
news:%23dN3UBC9FHA.1276@TK2MSFTNGP09.phx.gbl...
> "Hieu Le Trung"  wrote in message
> news:e4e4Bk$8FHA.2364@TK2MSFTNGP12.phx.gbl
>> I have a COM exe which was declare as a windows service, a COM dll,
>> and a Client.
>>
>> The server have contain an interface of COM dll
>> and it has two methods GetObject and SetObject for getting and
>> setting this variable.
>>
>> Everything is OK with Get and Set method
>> But
>> When client call GetObject to get object from server, then store it
>> to a member variable of client. Then stop the server, start it again.
>> When the client call SetObject and pass the variable store above to
>> server. I got exception The RPC server is unavailable.
>
> Who loads the DLL? In other words, who calls CoCreateInstance to create an 
> instance of the in-proc object that then gets passed around? Be aware that 
> an in-proc object cannot possibly outlive the process it is created in. It 
> sounds like that process gets terminated in your case.
> -- 
> 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, 28 Nov 2005 20:50:20 +0700   author:   Hieu Le Trung

Google
 
Web ureader.com


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