Pause statement opens and closes endlessly console windows

Pause statement opens and closes endlessly console windows

onkelhotte's picture

Hi there,

in a QuickWin project we´re checking a lot of things. When a check fails, we have this kind of error handling:

pause 'MyErrorText'
stop

I don´t know if this is WIndows7 dependent, but our program opens a console window just to close it immediatly after that. And then it opens another console window and closes it. And then again and again. We can just abort it by logging off windows itself because the task manager can´t close the program because every console window gets focus.

Does anybody have this problem too?

Thanks in advance,

Markus

7 posts / 0 new
Last post
For more complete information about compiler optimizations, see our Optimization Notice.
Steve Lionel (Intel)'s picture

I can't reproduce this with a simple program. In fact, QuickWin puts the Pause text and waits for response in the normal QuickWin window, not in a separate console window. Can you show a small but complete program that demonstrates the problem?

Let me also suggest MESSAGEBOXQQ (or MessageBox from USER32) as an alternative to PAUSE.

Steve
onkelhotte's picture

I was not precise enough... The pause statement is in a dll which is called by a QuickWin program.

I modified the poker sample where the problem arises too. In the Help - Contents Dialog is a new Button1. When you click it, the subroutine of the dll is being called. There is just a pause statement and it keeps flashing.

Markus

Attachments: 

AttachmentSize
Download poker.zip1.71 MB
Steve Lionel (Intel)'s picture

Well, there's your problem. A Quickwin program can't call a Fortran DLL because there will then be two copies of the Fortran runtime library, and Quickwin depends on static linking.

Steve
onkelhotte's picture

Quote:

Steve Lionel (Intel) wrote:

Well, there's your problem. A Quickwin program can't call a Fortran DLL because there will then be two copies of the Fortran runtime library, and Quickwin depends on static linking.


Well, but we do :-)
We have certain projects were we have a QuickWin or a WPF GUI and some calculation kernels as DLL which we use side by side. I´m not sure if we have all the sources of our DLLs...
So would it be better or necessary to change the DLLs into LIBs and link them?
Could I use the DLLs and prevent that there are two copies of the Fortran runtime library? Anyway: How do two copies hurt me?

Thanks for the answer,
Markus

Steve Lionel (Intel)'s picture

Don't use PAUSE or anything that needs the console. You might be able to get away with it as long as you're not trying to use the console or do I/O to units open in QuickWin. Use MessageBox if you want to put out a message and wait for response.

Steve
onkelhotte's picture

Quote:

Steve Lionel (Intel) wrote:

Don't use PAUSE or anything that needs the console. You might be able to get away with it as long as you're not trying to use the console or do I/O to units open in QuickWin. Use MessageBox if you want to put out a message and wait for response.


I can´t change pause into something else in 3rd party code... As I said, from some DLLs we have no source code any more.
But thanks for the explanation. I´ll see what I can do.

Login to leave a comment.