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