Pause statement opens and closes endlessly console windows

Pause statement opens and closes endlessly console windows

onkelhotte的头像

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 帖子 / 0 全新
最新文章
如需更全面地了解编译器优化,请参阅优化注意事项
Steve Lionel (Intel)的头像

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的头像

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

附件: 

附件尺寸
下载 poker.zip1.71 MB
Steve Lionel (Intel)的头像

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的头像

引文:

Steve Lionel (Intel) 写道:

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)的头像

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的头像

引文:

Steve Lionel (Intel) 写道:

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.

登陆并发表评论。