Something like :-
namespace MyNamespace
{
public __gc class MyObject : public MarshalByRefObject
{
public:
Object* InitializeLifetimeService()
{
// This lease never expires.
return 0;
// Use following code to define the exact lease time.
ILease* lease = static_cast<ILease*>(
MarshalByRefObject::InitializeLifetimeService());
if (lease->CurrentState == LeaseState::Initial)
{
lease->InitialLeaseTime = TimeSpan::FromSeconds(5);
lease->SponsorshipTimeout = TimeSpan::FromSeconds(0);
lease->RenewOnCallTime = TimeSpan::FromSeconds(5);
}
return lease;
}
};
}
BTW, since you return at the beginning of the function the rest of the code
never gets executed.
--
Regards,
Nish [VC++ MVP]
> Hello
>
[quoted text clipped - 25 lines]
>
> Thanks in advance!!!
Jos? Achig - 18 Sep 2003 20:33 GMT
Thank you for your response.
I'm very glad,
I hope you have a nice day!!!
Jose