I am new to this forum so please excuse any errors i make! I have recently started programming in c++ and one of my first projects is making a console trainer for AssaultCube (FPS Game). I have some errors and have not been able to fix them.
GetWindowThreadProcessId(hGameWindow, &dwProcID);
if (dwProcID !=0)
{
hProcHandle = OpenProcess(PROCESS_ALL_ACCESS, FALSE, dwProcID);
if(hProcHandle == INVALID_HANDLE_VALUE || hProcHandle == NULL)
{
GameStatus = "Failed to open process for handle value...Too Bad you didn't buy the warranty cause this ain't workin";
}
else
{
GameStatus = "I Hope your ready to start hacking";
IsGameAvail = true;
}
}
else
{
GameStatus = "You Broke it...Nah just kidding, Failed to get proccess id, Check the warranty number on the back of the purchase box for full details on receiving a refund.";
}
}
else
{
GameStatus = "You need to load AssaultCube before you hack it! DUUUUHHHHHH!";
}
No. Using std:: is good practice. usingnamespace std; bring in heaps of stuff from the std namespace, polluting the global namespace and possibly causing naming conflicts.
One can do this for frequently used things:
1 2 3 4 5 6 7 8 9
//#includes
using std::cout;
using std::cin;
using std::endl;
using std::string;
using std::vector;
//etc for other things
Now you can use cout, cin etc without the qualification of std::
Then use std:: for things you may not use as much, like std::find say.
A lot of people use std:: all the time regardless. The advantage of this that I can send you my function without you having to change anything.
Yes you fixed it! Thank you so much! I really appreciate it. For some reason it's not loading anything into the console. Just a black console window... Any ideas?
the program is complete with no errors (thanks to the help of you guys!:])
but i have a problem... when i debug it, the console screen appears, but nothing else no text, nothing. When i view it through the folders it appears but does not work properly. when i press f1 or f2 it doesnt work. it doesn't recognise the game unless the game is loaded before the program.
It is essentially an interface that does nothing.