Link to home
Start Free TrialLog in
Avatar of sankar012898
sankar012898

asked on

COM server hangs when the user presses "stop debugging" from Visual Studio menus

Hi,

I have a COM object( let us say "first") which creates an instance of another COM object called Test. My application is integrated with VC++ and we allow this "Test" object to be debugged from our application through Visual Studio. When an user is debugging the "TEST" component from our application, the user suddenly presses "stop debugging" in the VC++ menus.
Now, The COM server/exe( "TEST" object) dies since the user has pressed "stop debugging". Here, the COM object "TEST" created using "first" Object is being debugging by VC++ from my application.

The problem is that, when the user presses "stop debugging" from VC++ for the "test" COM object, the "first" COM object hangs sometimes...because
"first" COM object holds a reference to this "TEST" object which is dead (because the user presses "stop debugging" from VC++ menus for the "TEST" object). Sometimes, the "first" com object returns a RPC Error like a good boy.Sometimes it hangs.

Is there anyway to prevent this hang ?

Thanks for your time & help,

Sankar









Avatar of ShaunWilde
ShaunWilde

have disconnect option on your first object which you can call - which will disconnect it from the TEST object and then 'stop debugging' the TEST object
Avatar of sankar012898

ASKER

Hi Shaun Wilde,

Thanks for your answer. It was very useful to us.
Please put it as an "answer" and I will accept it.

Thanks
Sankar
ASKER CERTIFIED SOLUTION
Avatar of ShaunWilde
ShaunWilde

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial