Solved

Thread status

Posted on 2002-07-26
5
206 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
  • 2
5 Comments
 

Author Comment

by:madhusr
Comment Utility
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
Comment Utility
>>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
Comment Utility
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

Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
Importing  SSL Certificate into Firefox using GPO 28 191
cat dog challenge 18 122
List out all word 7 218
substring method in java 1 79
In this article, I'll describe -- and show pictures of -- some of the significant additions that have been made available to programmers in the MFC Feature Pack for Visual C++ 2008.  These same feature are in the MFC libraries that come with Visual …
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…
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.
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…

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

13 Experts available now in Live!

Get 1:1 Help Now