I'm trying to set a timer so that it only checks mouse-clicks after a specified time since the last mouse click. Here's the relevant code:
long lTriggerTimer;
long lTimerCounter;
I set them each to zero at the start of the program:
lTriggerTimer=0;
lTimerCounter=0;
Then in my message handler in the case of left mouse button down I test to see if lTriggerTimer == 0 and if so do my business and reset the variable:
if (lTriggerTimer==0)
{
Do relevant stuff
lTriggerTimer=1;
}
And in my main program loop I incriment the timer and reset it when necessary:
if (lTrigger==1)
{
lTimerCounter=lTimerCounter+1;
if(lTimerCounter==30)
{
lTriggerTimer=0;
lTimerCounter=0;
}
}
Everything compiles fine, but there is no noticable delay when I click the left mouse button. I've changed the check value in the program loop to 300, 3000 and 30000 with the same result.
Any ideas what I'm doing wrong?
Also (and I apologize if this is a stupid question, but I'm using MS VC++ Learning Edition that I got with a book that doesn't explain everything properly (IMO)), what is the name of and function of the -> operator? As in, rc->left=whatever. Does it just reference a property of an object? If so, why wouldn't you just use: rc.left=whatever?
Sorry for the "newbie" questions, guys. But how do I convert from one variable type to another? In VB we use CInt, CStr, etc., but I'm not sure of the function name/syntax to do this in VC++.
Thanks again.
Jason