COM Doubt(urgent)

Posted on 2003-03-13
Medium Priority
Last Modified: 2013-11-25

We have a situation like this

We have an OLE automation server which is an MDI application.(DNR). and a client application which automates the server.

[ This is very simple like we are writing an Automation client for excel.]

From the client application we create server object and created/get internal objects of server.

Same time user can close the server application window by clicking the CLOSE button or FILE/EXIT.

How the client knows the server is exited. Is there any standard method in COM to handle this situation?

(We prefer catching an error in client side. rather than modifying server code. )

Question by:anuragvelekkattu
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions

Expert Comment

ID: 8134828
Hi ,

 check out this article in MSDN. This explains how to catch an server event in the application...

HOWTO: Catch Microsoft Word97 Application Events Using VC++

Expert Comment

ID: 8135873
You need to use FindWindow , EnumWindowProc and other API funct. in order to determine whether the process is running
LVL 12

Expert Comment

ID: 8138149

 Usually the only way to know you are dropped is to Poll. That is to send a hearbeat to the server every few ms or so.

 Use SetTimer to set up a timer and when the timer hits try to contact the server if the function fails then you know the server is gone.

 Also take a look a connection points or IAdviseSink. You client can become an observer and the server will notify it when itis shutting down. This is the cleanest way.
 I know you dont want to modify the server but it may be the most efficient solution.

Accepted Solution

modulo earned 0 total points
ID: 11824912
PAQed - no points refunded (of 50)

Community Support Moderator

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction: The undo support, implementing a stack. Continuing from the eigth article about sudoku.   We need a mechanism to keep track of the digits entered so as to implement an undo mechanism.  This should be a ‘Last In First Out’ collec…
In this post we will learn different types of Android Layout and some basics of an Android App.
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…

770 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question