Cheat Engine Forum Index Cheat Engine
The Official Site of Cheat Engine
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


C++ need some help

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming
View previous topic :: View next topic  
Author Message
Snootae
Grandmaster Cheater
Reputation: 0

Joined: 16 Dec 2006
Posts: 969
Location: --->

PostPosted: Fri Apr 04, 2008 11:40 pm    Post subject: C++ need some help Reply with quote

hey guys, i'm working on my bot in C++, but i've got an error




my code is like this:
Code:
void sendshit(INT key)
{
   mswin = FindWindowW(L"MapleStoryClass", NULL);

   lParam = MapVirtualKey(key,0);
   lParam <<= 16;

   PMX(mswin,WM_KEYDOWN,key,lParam);
   Sleep(10);
   PMX(mswin,WM_KEYUP,key,lParam);
}


bool AutoAttack(void) // Main code
{
   for(;;) // Main loop
   {
   if (on == 1){
      sendshit(0x45);
      Sleep(300);
   }

   if (on == 0){
      ExitThread(0);
   }
   }
   return true;
}

bool HotKeys(void) // Main code
{
   for(;;) // Main loop
   {
      Sleep(20);

      if(GetAsyncKeyState(VK_F5) && (on == 0)) {
      on = 1;
      Edit_GetText(hWndAutoAttackDelay, AutoAttackDelayStr, 6);
      AADelay = _ttoi(AutoAttackDelayStr);
      CreateThread(0, 0, (LPTHREAD_START_ROUTINE)&AutoAttack, 0, 0, 0);
      Sleep(500);
      }

      if(GetAsyncKeyState(VK_F5) && (on == 1)) {
      on = 0;
      Sleep(500);
      }

   }
return true;
}



got any ideas, i've got nothing

_________________
Back to top
View user's profile Send private message
atom0s
Moderator
Reputation: 205

Joined: 25 Jan 2006
Posts: 8587
Location: 127.0.0.1

PostPosted: Sat Apr 05, 2008 3:10 pm    Post subject: Reply with quote

Read the error, it says there was an error with: wcstol which I don't even see being used in the snippet of code you posted above. Mind posting the code that uses that function?
_________________
- Retired.
Back to top
View user's profile Send private message Visit poster's website
hcavolsdsadgadsg
I'm a spammer
Reputation: 26

Joined: 11 Jun 2007
Posts: 5801

PostPosted: Sat Apr 05, 2008 3:39 pm    Post subject: Reply with quote

Also, you might want to use the _T or TEXT macro's instead of straight up 'L' unless you want to be bound to unicode.
Back to top
View user's profile Send private message
atom0s
Moderator
Reputation: 205

Joined: 25 Jan 2006
Posts: 8587
Location: 127.0.0.1

PostPosted: Sat Apr 05, 2008 3:52 pm    Post subject: Reply with quote

slovach wrote:
Also, you might want to use the _T or TEXT macro's instead of straight up 'L' unless you want to be bound to unicode.


From the looks of it hes already bound to using Unicode as hes using all the unicode functions straight up instead of using the API macros.

_________________
- Retired.
Back to top
View user's profile Send private message Visit poster's website
hcavolsdsadgadsg
I'm a spammer
Reputation: 26

Joined: 11 Jun 2007
Posts: 5801

PostPosted: Sat Apr 05, 2008 4:01 pm    Post subject: Reply with quote

Wiccaan wrote:
slovach wrote:
Also, you might want to use the _T or TEXT macro's instead of straight up 'L' unless you want to be bound to unicode.


From the looks of it hes already bound to using Unicode as hes using all the unicode functions straight up instead of using the API macros.


Oh geez, I glanced right over the W, heh
Back to top
View user's profile Send private message
Snootae
Grandmaster Cheater
Reputation: 0

Joined: 16 Dec 2006
Posts: 969
Location: --->

PostPosted: Sat Apr 05, 2008 8:17 pm    Post subject: Reply with quote

yeh, using unicode, btw wicaan, i tried to check that but i have no idea what wcstol.c is, and the code on my 97th line is a comment
_________________
Back to top
View user's profile Send private message
atom0s
Moderator
Reputation: 205

Joined: 25 Jan 2006
Posts: 8587
Location: 127.0.0.1

PostPosted: Sat Apr 05, 2008 9:47 pm    Post subject: Reply with quote

The error was referring to the 97th line of the wcstol.c file. Don't look inside that file or edit it though it wont help you in the least bit lol.

Anyway, are you making any calls to:
strtol, wcstol, or _tcstol

And if not, debug your app and step through each line of code to see what line it is erroring on. If you compiled in debug mode, you should be able to debug it by clicking retry on that error box and looking at the call stack to see what called that function to cause the error.

_________________
- Retired.
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group

CE Wiki   IRC (#CEF)   Twitter
Third party websites