User forums > Help

Code::Blocks console won't close.

<< < (2/2)

perento:
Sorry for the double post, so after i download the Windows SDK 7.1 newest version the problem still occured. This is the code i used, but again i think its not from the code couse it happens whit few of my source codes so far and i really, really want to use Code::Blocks as my main IDE, would like really much to fix my problem and keep growing my knowledge in C++ couse its a great language wich wont fit in unconfortable IDE like DevC, whit exuse.

If further info is needed ill post everything needed to help resolving this problem!

PS: i hit 2 times the number 4 from the keyboard then tryed to close the console, "Process returned...." pops up, after i couldnt close the console so im forced to resstart my computer now. Would be very, very thankfull if someone look closely into my problem. Thank you!

--- Code: ---#include <iostream>
#include <conio.h> //kbhit()
#include <windows.h> //timing
#include "monk.h" //monk header, declerations of class and functions
#include "Troll_Chieftain.h" //troll header, declerations of class and functions

using namespace std;

int main() //Main Function
{
    //Monk
    monk m;
    m.health = 2100;
    m.maxHealth = 2100;
    m.attack = 76;

    //Troll Chieftain
    Troll_Chieftain troll;
    troll.health = 1850;
    troll.attack = 110;

    cout << "Monk health is " << m.health << " and " << m.attack << " attack" << endl;
    cout << "VS" << endl;
    cout << "Troll Chieftain health is " << troll.health << " and " << troll.attack << " attack" << endl;
    cout << endl << endl;
    cout << "Chooice a skill:" << endl;
    cout << "'Basic Attack' - [1]" << endl;
    cout << "'Sunfire Recovery' healing Monk for 100 health  - [2]" << endl;

    bool game_over (false);

    int input;

    while (!game_over)
    {
        if (!kbhit()) //return TRUE if any key is pressed
        {
            input = getch();
        }

        //MONK CHAMPION
        if (input == 49) // auto attacks
        {
            cout << "Attacking" << endl;
            troll.TrollTakesDamage(m.attack);
        }
        else if (input == 50) //Sunfire Recovery heals for 100 hp
        {
            cout << "Healing" << endl;
            m.SunfireRecovery(m.health);
        }
        else
        {
            cout << "Invalid skill!" << endl;
        }

        if (m.health <= 0)//CHECK IF MONK IS DEAD
        {
            game_over = true;
            cout << "You have been trolled by Troll Chieftain, HUEHUEHUE!" << endl;
        }

        //TROLL CHIEFTAIN MOB
        if (troll.health <= 0) //if Troll Chieftain is dead, game over end of main loop
        {
            game_over = true;
            cout << "You have slain Troll Chieftain!" << endl;
        }
        else
        {
            cout << "Troll attack" << endl;
            troll.TrollTakesDamage (m.attack);// if troll chieftain alive attack
        }

    Sleep (2000);
    }

return 0;
}
--- End code ---

JackDawson:
2 Things here. 1, I can not test your code unless you put it all there... I mean from the looks of it, it looks fine, so the error could be in another file.

The other thing is, what Service Pack are you using for your XP ?  Because the SDK 7.1 you downloaded for XP will ONLY work with XP that has Service Pack 3. It will not work with any other versions of XP.

On a side note, is this your project or you get his code from someone ? Because lets say I test your code, will I need any media ?  Like music or Objects ( Models )..  things of this nature. If so, then you'll have to ZIP it all up if you want me to personally test this for you. If you do not know how to ZIP a program, look up WinZIP or WinRAR. Once you ZIP it up, you can put it on a website like http://www.mediafire.com that offer free file hosting and then paste the link here.

perento:
Here is the the big code http://www.mediafire.com/?26xxj2ycfm442rc
and here is the very small one that is bugging me too http://www.mediafire.com/?ocedtt0nd67nv80

I did read Windows SDK require Windows XP Service Pack 3 and i have it on my computer

Im writing this whti a friend that is showing me stuff how a nice readable code should look and etc etc. like a teacher but something happend whit my own code that i did write on my self, so he send me his project wich was exactly the same the miniRPG (its the first link).
The second link is my own code i write on myself and it bugg the console too.

You do not need any objects to compile this, its just a text based real-time game whit a mob.
I hope you figure out what my issue is and help me out.
kind regards!

JackDawson:
Ok, well the code is fine. I tested it and C::B does not lock up. The console does close for me with no problems. So whatever is going on, its on your Operating System ( Graphic ) end. Basically, your Windows XP might be having a glitch with your graphic drivers. Another issue I have seen in the past is that If you have your Magnify settings in your windows different then where your mouse SHOULD be clicking, it wont find the "hot spot" of where your trying to click. Meaning the graphic settings are out of adjustment. Check your graphic card and other graphic settings. Then maybe you can find out why your Console Window is not closing. But after looking at everything, its been determined in my opinion that this is not a C::B issue and so this Forum will not be able to help. The Forum rules are specific on this very point.

However, Good luck on finding your graphic glitch because that's what it sounds like to me. Its not C::B that is causing the issue.

perento:
ok i reinstall the drivers (wich are the same now) i cant use better drivers or just any other graphics drivers due some retarded bug but thats not releated to C::B

I did compile few times and console didnt stucked at all, im very thankfull for yoru support and time sharing to look on my issue, it really helped me!
Have a nice day mate.

-perento

Navigation

[0] Message Index

[*] Previous page

Go to full version