Solved

Thread status

Posted on 2002-07-26
5
211 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

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Unix / Linux grid computing 5 173
matchUp  challenge 6 83
has77  challenge 9 107
Windows shortcut location resolution on double click open 4 78
Here is how to use MFC's automatic Radio Button handling in your dialog boxes and forms.  Beginner programmers usually start with a OnClick handler for each radio button and that's just not the right way to go.  MFC has a very cool system for handli…
If you use Adobe Reader X it is possible you can't open OLE PDF documents in the standard. The reason is the 'save box mode' in adobe reader X. Many people think the protected Mode of adobe reader x is only to stop the write access. But this fe…
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 a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…

710 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