Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
29261 Discussions

A simple Quickwin program freezes on Windows 7. a bug?

csmao
Beginner
1,846 Views
Dear all:

I posted a question two days ago and did not get any reply.
This time I include a simple test program.
The program freezes after displaying a messagebox.
Comment the call out and the program runs fine. don't know why?
Here is the program:

USE IFQWIN
IMPLICIT NONE
TYPE (QWINFO) QWI
INTEGER I,CONSOLE/1/

OPEN(UNIT=CONSOLE,FILE='USER',TITLE='Console')
QWI%TYPE = QWIN$MAX
I = SETWSIZEQQ(CONSOLE,QWI)
I = INITIALIZEFONTS( )
CALL CLEARSCREEN($GCLEARSCREEN)

! The following call freezes the program.
I = MESSAGEBOXQQ('Continue?'C,'Matrix'C,MB$YESNO)

DO WHILE(.TRUE.)
CALL SLEEPQQ(0)
END DO

STOP
END

LOGICAL*4 FUNCTION INITIALSETTINGS( )
USE IFQWIN
IMPLICIT NONE
TYPE (QWINFO) QWI
LOGICAL OK

OK = INSERTMENUQQ(1,0, $MENUENABLED, '&File'C, NUL)
OK = APPENDMENUQQ(1, $MENUENABLED, 'E&xit'C, WINEXIT)

INITIALSETTINGS= .TRUE.
END FUNCTION

I compile the program using IVF 11.1.048 under VS2008.
Any help will be appreciated.

Mao
0 Kudos
19 Replies
Steven_L_Intel1
Employee
1,846 Views
The program worked fine for me on Windows 7 with the call. A note - the call to MESSAGEBOXQQ does not require C strings. They don't hurt, though.

When you say it freezes, what do you mean? If you click on Yes from the message box, can you not pull down File > Exit?
0 Kudos
csmao
Beginner
1,846 Views
The program worked fine for me on Windows 7 with the call. A note - the call to MESSAGEBOXQQ does not require C strings. They don't hurt, though.

When you say it freezes, what do you mean? If you click on Yes from the message box, can you not pull down File > Exit?
Thanks, Steve.
Yes, after I click yes (or no) from the message box, the window freezes and I cannot pull down or access File>Exit.
I cannot move or resize the frame window.
I have to terminate the program from windows's task manager.
I test the program in debug as well as release mode. They all give the same result.
I am not sure if there are any compiler switches I have to set.
Thanks again.

Mao
0 Kudos
Steven_L_Intel1
Employee
1,846 Views
There are no switches to set that would affect this behavior. I will suggest using 100 or 200 as the argument to SLEEPQQ rather than 0, as the latter will still make the main thread CPU-bound. This might make the window unresponsive on a single-core system.

Can anyone else running Windows 7 see this problem?
0 Kudos
nvaneck
New Contributor I
1,846 Views

Good to know about MESSAGEBOXQQ and the C strings; it makes things a little easier for me. The documentation does say they have to be C strings, at least in my version (10).
0 Kudos
Steven_L_Intel1
Employee
1,846 Views
Perhaps I am wrong about the C strings.. Doesn't hurt to use them. You're right that it's documented that way.
0 Kudos
nvaneck
New Contributor I
1,846 Views
Perhaps I am wrong about the C strings.. Doesn't hurt to use them. You're right that it's documented that way.

As it turns out, they are required. I have 28 invocations of it, and while most seem to work without being C strings, I have at least one that does not.
0 Kudos
Steven_L_Intel1
Employee
1,846 Views
I sit corrected. Thanks.
0 Kudos
Chris_D
Beginner
1,846 Views
There are no switches to set that would affect this behavior. I will suggest using 100 or 200 as the argument to SLEEPQQ rather than 0, as the latter will still make the main thread CPU-bound. This might make the window unresponsive on a single-core system.

Can anyone else running Windows 7 see this problem?
Steve,
I tested this program and I have the same issue. I am running 64bit Windows 7 build 7100 (Not the release version).

Chris
0 Kudos
Steven_L_Intel1
Employee
1,846 Views
I am running the released version of Win 7 x64 and can't get this program to fail in either 32-bit or 64-bit.
0 Kudos
csmao
Beginner
1,846 Views
I am running the released version of Win 7 x64 and can't get this program to fail in either 32-bit or 64-bit.
Dear Steve:

I am testing this program on the released TRADITIONAL CHINESE version of 32-bit and 64-bit Win 7.
The program also has problem on my friend's win 7 installation.
I am not sure if this is related to the localized version of Win 7.
How should I proceed? Microsoft or Intel?

Your kind suggestions are appreciated.

Mao
0 Kudos
Steven_L_Intel1
Employee
1,846 Views

I wonder if this is related to the "language bar" background process CTFMON.EXE. This is widely known as interfering with many applications. You might try, as an experiment, stopping the process running CTFMON.EXE and see if the problem remains.

I will send a report to our developers to see if they can reproduce it.
0 Kudos
csmao
Beginner
1,846 Views

I wonder if this is related to the "language bar" background process CTFMON.EXE. This is widely known as interfering with many applications. You might try, as an experiment, stopping the process running CTFMON.EXE and see if the problem remains.

I will send a report to our developers to see if they can reproduce it.
Dear Steve:

Thanks for your prompt reply.
I rewrite the program and put the messagebox call in a menu callback, then the program runs!
don't know why?
For your information, here is the revised program:

USE IFQWIN
IMPLICIT NONE
TYPE (QWINFO) QWI
INTEGER I,CONSOLE/1/

OPEN(UNIT=CONSOLE,FILE='USER',TITLE='Console')
QWI%TYPE = QWIN$MAX
I = SETWSIZEQQ(CONSOLE,QWI)
I = INITIALIZEFONTS( )
CALL CLEARSCREEN($GCLEARSCREEN)

! The following call freezes the program.
! But if I put it in a menu callback (see below), then everything is fine.
! I = MESSAGEBOXQQ('Continue?'C,'Matrix'C,MB$YESNO)

DO WHILE(.TRUE.)
CALL SLEEPQQ(100)
END DO

STOP
END

LOGICAL*4 FUNCTION INITIALSETTINGS( )
USE IFQWIN
IMPLICIT NONE
TYPE (QWINFO) QWI
LOGICAL OK
EXTERNAL RUN

OK = INSERTMENUQQ(1,0, $MENUENABLED, '&File'C, NUL)
OK = INSERTMENUQQ(1,1, $MENUENABLED, '&Run'C, RUN)
OK = APPENDMENUQQ(1, $MENUENABLED, 'E&xit'C, WINEXIT)

INITIALSETTINGS= .TRUE.
END FUNCTION

SUBROUTINE RUN()
USE IFQWIN
IMPLICIT NONE
INTEGER I

I = MESSAGEBOXQQ('Continue?'C,'Matrix'C,MB$YESNO)

RETURN
END

Any thoughts?

Mao
0 Kudos
Steven_L_Intel1
Employee
1,846 Views

When you put it in a callback, it's executed from a different thread than the main program. The call to MESSAGEBOXQQ blocks the thread, but the main thread is still running. I don't understand, though, why this matters. I'm glad to hear that you found a solution.
0 Kudos
WW
Beginner
1,846 Views
We have the same problem! After calling a messagebox a simple Quickwin program freezes on Windows 7 both for win32 and x64. We use compiler version 11.1.065. Using Win XP+win32 everthing is ok. We have checked the mentioned solution as a callback function. Then everything is ok. But this is no solution. We need the messagebox directly and not 'hidden' in the callbackfunction.
Regards WW
0 Kudos
Wendy_Doerner__Intel
Valued Contributor I
1,846 Views
It looks like we never reproduced the original problem. Do you have a test case you can post here which demonstrates it?

------

Wendy

Attaching or including files in a post

0 Kudos
anthonyrichards
New Contributor III
1,846 Views
Have you considered substituting a call to the standard Windows API function MessageBox? All you need to do is add USE IFWIN (if using IVF) or USE DFWIN (if using CVF) to supply the interface for it and to define the parameters required such as MB_OK etc.
Here is the simplest console program that uses it.

program simplemessage

use dfwin

implicit none
integer iret

print *, 'Hello World'
iret=MessageBox(0,'Here is the message - Hello World!'c,'A simple message box Title'c,MB_OK)

end program simplemessage

0 Kudos
Steven_L_Intel1
Employee
1,846 Views
We can reproduce the problem, but the number of factors involved have, so far, stymied us in identifying a culprit. We continue to work at it and will be pulling in Microsoft to help us. I understand that this is a frustrating issue - it is for us too - but I don't anticipate a speedy resolution.
0 Kudos
Robert_M_Intel4
Employee
1,846 Views
We (at Intel) have been working on this for awhile, and may have a solution. Please refer to the topic 70026 in the Intel-visual-fortran-compiler-for-windows topic.

Bob Mance
0 Kudos
Robert_M_Intel4
Employee
1,846 Views
My name is Bob Mance and I've been working on this problem with Microsoft. I've posted a solution that works for yours, and several other reproducers posted in a separate (longer) thread. You can pick up a new ifqwin.lib file from that post, #94 I believe. The library was built for a 12.0/12.1 release and can be used on XP or Windows 7.

http://software.intel.com/en-us/forums/showthread.php?t=70026&p=10

Let me know if you try it and what you see. I have your application running here fine.

Thanks.

Bob
0 Kudos
Reply