Author | Message | Time |
---|---|---|
l2k-Shadow | So recently I actually picked up learning C++ seriously, and finally managed to get a bot to connect to battle.net and enter a channel successfully. However, right after it enters the channel, the program closes out, no errors or anything, it just simply quits. Also there are no errors or warnings given by the compiler (I'm using Dev-C++). Any ideas on why this would be happening? | November 6, 2006, 1:37 AM |
warz | Some sort of overflow, most likely, or non-null terminated char array that you're passing to some string function. Those tend to just close programs. Possibly a recursive loop? | November 6, 2006, 2:15 AM |
l2k-Shadow | Could be, i just sent source to a friend and he compiled it and it didn't close out for him. I can't restart my comp right now but once i can i'll see if that will make a difference.. | November 6, 2006, 2:37 AM |
Kp | Attach a debugger to it before you connect. If it is crashing, the debugger will report the exception when it happens (and halt program execution so you can see the crash). If it is simply terminating, you will see the debugger report that the program exited with no error. If you're not familiar with any other debugger, you can use ntsd (comes built-in on NT4, NT5.0, NT5.1, and NT5.2(?), but not on NT6(!)). Note that ntsd cannot natively read gcc debug information, so you may be better off trying to use gdb if you need symbolic debugging. | November 6, 2006, 4:23 AM |
l2k-Shadow | Well i hooked it with ollydbg and ran it through that and it doesn't terminate if i do that.. but if i want to run it on it's own it just closes out. EDIT: I'm not really sure what I did but I changed something and now it's working... thx anyway. | November 6, 2006, 5:34 AM |