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









sankar012898Asked:
Who is Participating?

Improve company productivity with a Business Account.Sign Up

x
 
ShaunWildeConnect With a Mentor Commented:
an answer see above - by the way you can also accept comments as answers
0
 
ShaunWildeCommented:
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
0
 
sankar012898Author Commented:
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
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.