Jump to content
  • 0
jen

C++ While Loop Not Responding

Question

Hey guys.

I'm missing out on something here because my while loop keeps putting my program to "Not Responding" state. How do I sort this out?

What happens, the program will process the app->Loop() inside the while loop (while(app->Loop()) but it cause the program to go "Not Responding".

It's crashing it's just the while loop is infinite seems like.

Project is very basic:

qvPgoZ2.jpg

CvRIKyl.jpg

  • Like 1

Share this post


Link to post

6 answers to this question

Recommended Posts

  • 1

This should sort itself out, once you actually do anything. ;)

Windows says that a program is not responding, if it does not check its event-queue for some time.

Try adding something like

if (window->KeyHit(Key::Escape) == true) {
	return false;
}

You actually don't even have to do anything with the result of KeyHit, you just need to call it, so it takes a look at the event-queue

  • Like 1
  • Upvote 1

Share this post


Link to post
  • 0

More screenshot: see? The console is still printing value (I changed the line inside while to produce random number) but the main window is "not responding". It's weird because I sorted this out before with the Border Recon project, I just can't remember how. I also tried copying Brecon' main and app codes but didn't change anything.

1MUvrDX.jpg

Share this post


Link to post
  • 0

@gamecreator yea the same result with sleep(1) & sleep(0).

Interesting note: I'm using VS 2017... this may have something to do with the problem? hmm

I use VS 2015 for Brecon on my desktop...

I just realized that actually. I'll try 2015.

I use the same compilers in both programs.

Share this post


Link to post
  • 0
12 hours ago, Ma-Shell said:

Windows says that a program is not responding, if it does not check its event-queue for some time.

I never seen this situation before, but man, it is good to know this. I can imagine pulling my hear out on this. Great answer Ma-Shell.

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Create Your Account

Sign in

Already have an account? Sign in here.

Sign In Now
×