0

I have a client program that uses a MarshalByRefObject to get a variable from a remote server. Sometimes the program hoses up on the remote server and when I try to get that variable my client program simply hangs. Is there a way to time out the call on this variable?

MyClass^ refObject = (MyClass^)System::Activator::GetObject(MyClass::typeid, url);

THEVARIABLE objectVariable = refObject->theVariable;
LightLabyrinth
  • 362
  • 3
  • 14

1 Answers1

0

The only way I see is to implement an IMessageFilter (COM). In some cases it is possible to detect that there is an out of process call from the current STA to another. But AFAIK this is only done when an input message (keyboard/mouse) arrives.

With a message filter you can show something like "waiting for external com call...". Also in this case you may abort the external call.

See CoRegisterMessageFilter, and IMessageFilter

xMRi
  • 14,982
  • 3
  • 26
  • 59