Solved

Application Timeout

Posted on 2002-06-19
5
136 Views
Last Modified: 2010-05-02
Hi All,

I am developing an application which includes multiple out-of-process exe's opened in it, at any point will not be known how many exe's are running. When there is no activity is done for certain period of time in any applicaion( either in main or in child applicatons which are opened by main app including any other resources), the application and its children should be released properly).

Please provide any links relavent to this issue or source code is highly appreciated.

Thanks a lot in advance

Madhu
0
Comment
Question by:madhusr
5 Comments
 
LVL 142

Accepted Solution

by:
Guy Hengel [angelIII / a3] earned 150 total points
Comment Utility
There are 2 parts:
* each procedure (in main or child exe) will need to log this fact to a common place.
* each exe needs to check each x seconds if the log in the common place has been modified more recently that the timeout value. Of course, this check shouldn't log itself to that place, only read.

Up to your choice you can have the following options for the common place:
* a file where the only content is the date+time when the last operation succeeded. This could be problematic as more exe could start. Anyway, as it's IO, don't do it except for simplicity reasons.

* a registry entry is kept in memory and would be fast for read & write. again, a simple date+time value would be fine.

* another out-of-exe activex exe that logs the control of the activity, and could choose to raise an event for each exe to close down ... This activex then needs of course the GetObject support, which you can find in the internet how to do...

CHeers
0
 

Author Comment

by:madhusr
Comment Utility
Hi CHeers,

Can this job be done using WIN32 API. Can the main exe be notified when there is an activity occured in the child exe using any message hooking or message sending?

souce code is appreciated.

Madhu
0
 
LVL 142

Expert Comment

by:Guy Hengel [angelIII / a3]
Comment Utility
I would implement a small ActiveX dll for notification process:
say a project NotificationServer, 1 class (NServer).
This class has 2 event (SimpleNotify with 1 parameter, and ComplexNotify with 1 variant array), and 2 methods (CallSimpleNotify and CallComplexNotify).
The main exe creates an instance, and passes the instance to the child activex-exe. The child exe can call the methods, and the main exe can get the events...

I don't know how I would do this using API...

CHeers
0
 
LVL 49

Expert Comment

by:DanRollins
Comment Utility
Hi madhusr,
It appears that you have forgotten this question. I will ask Community Support to close it unless you finalize it within 7 days. I will ask a Community Support Moderator to:

    Accept angelIII's comment(s) as an answer.

madhusr, if you think your question was not answered at all or if you need help, just post a new comment here; Community Support will help you.  DO NOT accept this comment as an answer.

EXPERTS: If you disagree with that recommendation, please post an explanatory comment.
==========
DanRollins -- EE database cleanup volunteer
0
 

Expert Comment

by:SpideyMod
Comment Utility
per recommendation

SpideyMod
Community Support Moderator @Experts Exchange
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Suggested Solutions

There are many ways to remove duplicate entries in an SQL or Access database. Most make you temporarily insert an ID field, make a temp table and copy data back and forth, and/or are slow. Here is an easy way in VB6 using ADO to remove duplicate row…
You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

728 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now