Solved

Thread status

Posted on 2002-07-26
5
214 Views
Last Modified: 2013-11-20
Hello Experts!!!

I am developing an application idle time tracker component. The basic idea of this component is to timeout the application in a given length of time. I am almost through but some minor issues.

let me explain the way the application and my component is integrated first.

The dll is used to monitor the activities(mouse/keyboard) in the application.

My dll method:

STDMETHODIMP CIdleUI::IdleUIGetLastInputTime(long pLIPTICK)
{
 *pLIPTICK = (GetTickCount()-g_dwLastInputTick)/1000;
 return S_OK;
}

I have a VB standard exe application in which my dll is installed to monitor the activities throught out the application and timer control to constantly check to see whether there have been any activities performed in the application by calling the above dll method to update the time.

Also this a menu form. In each menu item invokes an exe file. In turn each exe has operations like opening crystal reports and etc.

If there is no activity occured during the given time my dll terminates the application, otherwise reset the timer to given time say (60 seconds).

The problem is while my crystal reports is being loaded (takes quite a long) through my second exe the timer which is residing in the first exe is updating(say 5,4,3,2,1).But it should wait for crystal reports to complete its loading.Because this an activity related to our application.

I would be very greatful if any of you can help me how to make my timer to wait until crystal report gets loaded through my dll.

Is there any way to check in the above method like

if GetCurrentThread is completed then

*pLIPTICK = (GetTickCount()-g_dwLastInputTick)/1000;


Please let me know the problem is unclear.

Madhu





0
Comment
Question by:madhusr
[X]
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
  • 2
5 Comments
 

Author Comment

by:madhusr
ID: 7181662
Hi Experts!

This requirement is similar to a progress bar but for given process.

I would like to get the progress of a given process.

Thanks,
Madhu
0
 
LVL 3

Accepted Solution

by:
elcapitan earned 200 total points
ID: 7184466
>>if GetCurrentThread is completed

You can signal event (with SetEvent()) when thread is exiting and "catch" the event in the dll with WaitForSingleObject().

--EC--
0
 

Author Comment

by:madhusr
ID: 7187035
Hi EC,

It would be great if you could send me the chunk of code how to and where to handle it. Because I am new to VC and WIN32 API programming.

Thank you,
Madhu.
0

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: Database storage, where is the exe actually on the disc? Playing a game selected randomly (how to generate random numbers).  Error trapping with try..catch to help the code run even if something goes wrong. Continuing from the seve…
Introduction: Dialogs (1) modal - maintaining the database. Continuing from the ninth article about sudoku.   You might have heard of modal and modeless dialogs.  Here with this Sudoku application will we use one of each type: a modal dialog …
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.
In this brief tutorial Pawel from AdRem Software explains how you can quickly find out which services are running on your network, or what are the IP addresses of servers responsible for each service. Software used is freeware NetCrunch Tools (https…

617 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