View Full Version : Hurays, another nub problem ^^
sk1ndead
11-29-2007, 02:05 PM
I'm trying to add a 2nd hack in my c++ hack. But when i click on classwizard. I can't use the "add function" coz there is already a timer
how can i add a second timer?:p
wr194t
11-29-2007, 02:59 PM
Your first timer will probably look like this:
case FIRSTTIMER:
{
code here
}
break;
}
CDialog::OnTimer(nIDEvent);
}
To add more than one timer, you need to do this:
case FIRSTTIMER:
{
code here
}
break;
case SECONDTIMER:
{
code here
}
break;
case THIRDTIMER:
{
code here
}
break;
And so on. At the bottom of your last timer (under break;) paste this:
}
CDialog::OnTimer(nIDEvent);
}
sailerboy
11-29-2007, 07:50 PM
for more than one timer, i do this
if (button1 == true) //hack here
if (button2 == true) //another hack here
and so on. In addition to the code pointing to the timer, you need to put something like this
button1 = true;
sk1ndead
11-29-2007, 11:42 PM
I've tried wr194t's way.
I've put this into the coding part:
void CScopeDlg::OnTimer(UINT nIDEvent)
{
switch(nIDEvent)
{
case FIRSTTIMER:
{
Writelong (0x8DBAFC,1120403456);
}
break;
case SECONDTIMER:
{
Writelong (0xADD14C,1);
}
break;
}
CDialog::OnTimer(nIDEvent);
}
And i've defined the SECONDTIMER in the resource.
I've also made 2 buttons, 1 with
void CScopeDlg::OnCrosshairOn()
{
SetTimer(SECONDTIMER, 1, NULL);
}
The other 1 with
void CScopeDlg::OnCrosshairOff()
{
KillTimer(SECONDTIMER, 1, NULL);
}.
I'm getting these errors:
--------------------Configuration: Scope - Win32 Debug--------------------
Compiling...
ScopeDlg.cpp
C:Program FilesMicrosoft Visual StudioMyProjectsFirst hackScopeDlg.cpp(216) : error C2065: 'FIRSTTIMER' : undeclared identifier
C:Program FilesMicrosoft Visual StudioMyProjectsFirst hackScopeDlg.cpp(216) : error C2051: case expression not constant
C:Program FilesMicrosoft Visual StudioMyProjectsFirst hackScopeDlg.cpp(222) : error C2065: 'SECONDTIMER' : undeclared identifier
C:Program FilesMicrosoft Visual StudioMyProjectsFirst hackScopeDlg.cpp(222) : error C2051: case expression not constant
C:Program FilesMicrosoft Visual StudioMyProjectsFirst hackScopeDlg.cpp(227) : warning C4060: switch statement contains no 'case' or 'default' labels
Error executing cl.exe.
Scope.exe - 4 error(s), 1 warning(s)
Once again, putten the whole project below:p
m0she
11-30-2007, 02:48 AM
you needs to define the timer in resource.h look at the tut on how to make a timer and there you can see how to define a timer
sk1ndead
11-30-2007, 06:14 AM
EDIT: nvm, can be locked.
Will only take a li'l bit of time till I screw up with c++ again. You'll hear of me:D:p
Powered by vBulletin® Version 4.1.12 Copyright © 2012 vBulletin Solutions, Inc. All rights reserved.