| View previous topic :: View next topic |
| Author |
Message |
WafflesFTW Expert Cheater
Reputation: 0
Joined: 21 Mar 2008 Posts: 131
|
Posted: Wed Aug 27, 2008 6:57 pm Post subject: Compiles, but crashes. |
|
|
I'm attempting to code a bot using an OOP approach, but the project just crashes miserably after ticking a check box. It compiles, but the debugger says I'm passing a bad pointer to the static function. I've attached the relavent source files. Help would be greatly appreciated. I'm completely lost with this. I have no idea where to start.
The whole solution:
http://www.megaupload.com/?d=RNWSFR5U
I would really appreciate it if you could help. I've tried for literally 3 hours and have gotten absolutely no where.
|
|
| Back to top |
|
 |
kitterz Grandmaster Cheater Supreme
Reputation: 0
Joined: 24 Dec 2007 Posts: 1268
|
Posted: Wed Aug 27, 2008 7:03 pm Post subject: |
|
|
Brb ill take a look
Multiple problems:
1. DO NOT USE CloseHandle(), its not the proper thing to do.
| Code: | | TerminateThread (hBotFunction, 0); |
Replace them all with TerminateThread
2. The AutoClicker PostMessageX is wrong.
| Code: | PostMessageX(MShWnd, WM_LBUTTONDOWN, NULL, (LPARAM)&CursorPosition);
PostMessageX(MShWnd, WM_LBUTTONUP, NULL, (LPARAM)&CursorPosition);
|
This will send a click once.
3. You have
| Code: | | virtual BOOL BotFunctionThread();=0 | <<What?
change it to
| Code: | | virtual BOOL BotFunctionThread(); |
|
|
| Back to top |
|
 |
WafflesFTW Expert Cheater
Reputation: 0
Joined: 21 Mar 2008 Posts: 131
|
Posted: Wed Aug 27, 2008 8:14 pm Post subject: |
|
|
| Those aren't the problems. AutoLoot crashes, its not even creating the thread in order to be terminated (hence the crashing), and the abstract class was an attempted resolution which didn't work. In other words, I had it the way you had it beforehand. Im pretty sure it has to do with the polymorphic characteristics of the class... I'm just not sure exactly what.
|
|
| Back to top |
|
 |
kitterz Grandmaster Cheater Supreme
Reputation: 0
Joined: 24 Dec 2007 Posts: 1268
|
Posted: Wed Aug 27, 2008 8:17 pm Post subject: |
|
|
| Well with there changes, nothing crashes for me.
|
|
| Back to top |
|
 |
WafflesFTW Expert Cheater
Reputation: 0
Joined: 21 Mar 2008 Posts: 131
|
Posted: Wed Aug 27, 2008 8:19 pm Post subject: |
|
|
| It crashes when you tick/untick
|
|
| Back to top |
|
 |
Zand Master Cheater
Reputation: 0
Joined: 21 Jul 2006 Posts: 424
|
Posted: Wed Aug 27, 2008 9:32 pm Post subject: |
|
|
| Actually, what you should be avoiding is TerminateThread().
|
|
| Back to top |
|
 |
kitterz Grandmaster Cheater Supreme
Reputation: 0
Joined: 24 Dec 2007 Posts: 1268
|
Posted: Wed Aug 27, 2008 9:53 pm Post subject: |
|
|
| Zand wrote: | | Actually, what you should be avoiding is TerminateThread(). |
How so?
|
|
| Back to top |
|
 |
Zand Master Cheater
Reputation: 0
Joined: 21 Jul 2006 Posts: 424
|
|
| Back to top |
|
 |
HomerSexual Grandmaster Cheater Supreme
Reputation: 5
Joined: 03 Feb 2007 Posts: 1657
|
Posted: Thu Aug 28, 2008 4:40 am Post subject: |
|
|
hBotFunction = CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE)BotFunctionThreadStart, this, 0, NULL);
Uh, i'm looking for the BotFunctionThreadStart, and i don't see it
You should be calling botfuntionthread but also, you don't initalize the delay except for KeyBotFunctions which is never called in these routines. Is the crash due to an uninitalized variable being used?
_________________
|
|
| Back to top |
|
 |
WafflesFTW Expert Cheater
Reputation: 0
Joined: 21 Mar 2008 Posts: 131
|
Posted: Thu Aug 28, 2008 10:31 am Post subject: |
|
|
| BotFunctionThreadStart is a static function defined in the class. I can only call a static function within the class via createThread, so I need the static function to then call the virtual function. KeyBotFunctions/MouseBotFunctions is a constructor so its called and initialized then.
|
|
| Back to top |
|
 |
DeletedUser14087 I post too much
Reputation: 2
Joined: 21 Jun 2006 Posts: 3069
|
Posted: Thu Aug 28, 2008 10:35 am Post subject: |
|
|
| Read more about WM_LBUTTONDOWN notification, MK_LBUTTON -_-
|
|
| Back to top |
|
 |
HomerSexual Grandmaster Cheater Supreme
Reputation: 5
Joined: 03 Feb 2007 Posts: 1657
|
Posted: Thu Aug 28, 2008 2:14 pm Post subject: |
|
|
That shouldn't crash it though. It should just ignore it
_________________
|
|
| Back to top |
|
 |
|