Link to home
Start Free TrialLog in
Avatar of afos21
afos21

asked on

Further help for an application project!!

I have already gave a question about a project i have. You can see if interested the thread at   https://www.experts-exchange.com/questions/21857834/Verifying-the-source-code.html. I have already made some questions regarding this project and have received a lot of help. Now, the thing is that i need an extra function for my application which will enable the user to see the several time intervals between the several recorded movements.
 e.g: the mouse was doubleclicked in 0:07 seconds
        letter k was pressed at 0:09 seconds etc.etc.

Can someone provide me an algorithm or the coding for such a function?
Avatar of afos21
afos21

ASKER

Oh...and something that i forgot which is kind of irrelevant with what i have asked. The saved macro file will be saved and stored in a database which will be loaded in the application. Is there anything else than need to be added in the source apart from just insert a db support in the application wizard?
ASKER CERTIFIED SOLUTION
Avatar of AndyAinscow
AndyAinscow
Flag of Switzerland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Database support - what you said is roughly correct.  However you need to make some decisions first.  What database (eg Microsoft Access), how are you going to communicate with the database (DAO, ADO, ODBC...).

Also do you really need a database?  Would a simple text file be good enough for your requirements.
Avatar of afos21

ASKER

It is a requirement for my project. I know it's quite stupid because all it needs is a simple table which will retrieve the saved macro file. Therefore, the trouble of communicating with the database is much more than actually creating a db.

Regarding to what you said about the GetTickCount, is this a fixed function?
You could also override the PreTranslateMessage() method in your window class. The MSG structure passed into this function contains a time member in milliseconds which is equivalent to GetTickCount(), but it might be more convenient to insert this into only one place in your code.

Don't know what you mean by a "fixed function".
GetTickCount - yes that is an API function.  Just call it when you want to log the event.

Database - communicating isn't that much of a problem.  Just decide what you require before starting anything with the wizard.  (I'd tend towards Access + DAO for simplicity).
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of afos21

ASKER

Since there were 2 different opinions about the solution i will split the points between the two different answers, although i'm choosing the simplest one with gettickcount.
Thanx for your contribution
Alternatives - GetTickCount is simpler BUT only goes to milliseconds, the PerformanceCounter functions will be at an even finer level.  Its a matter of how accurate you require the time intervals.