views:

61

answers:

1

Hi all, I have an assignment were in I have to print the last active date of the process using a COM In Proc Server in C++. I tried doing that with getProcessTimes() function, but that gives me an access violation error.

First of all, I want to know if there is anyother command that gives the last active date of the process..

Second what is the problem with the following code

FILETIME ftCreation, ftKernel, ftUser;
GetProcessTimes(hProcess, &ftCreation, &ftExit, &ftKernel, &ftUser);`

I tried memsetting and several other alternatives but nothing works...

A: 

Here is an article that demonstrates how to use GetProcessTimes. It includes sample code. Another option is using WMI and the WIN32_Process class, which also has this information. Here is an example of how you would use WMI.

Garett