- 新着としてマーク
- ブックマーク
- 購読
- ミュート
- RSS フィードを購読する
- ハイライト
- 印刷
- 不適切なコンテンツを報告
Hi,
I am in the process of converting a CVF project to IVF (compiler version 10.0.027 with VS2003). I am getting a run-time error in a subroutine where I check if a console has been opened or not for the application. The subroutine is as follows:
SUBROUTINE CheckConsoleAvailability()
!Local variables
LOGICAL::Status
INTEGER::fhandle
TYPE(T_CONSOLE_SCREEN_BUFFER_INFO) cinfo
!Check if a console is available
Status=GetConsoleScreenBufferInfo(fhandle,cinfo)
IF (Status) RETURN !Available, do nothing
!If not available create one
Status=AllocConsole()
fhandle=GetStdHandle(STD_OUTPUT_HANDLE)
END SUBROUTINE CheckConsoleAvailability
The subroutine is in a module. At the top of the module I have USE IFWIN. When I run the Release version of the executable it runs fine. When I run the Debug version of the executable, it runs fine as well. But when I use Debug/Start from the VS2003 I get a window that says "Unhandled exception at 0x00500a2a in processor4_0.exe: User breakpoint." at line
Status=GetConsoleScreenBufferInfo(fhandle,cinfo)
When I comment out this line and do the same (Debug/Start) this time I get the same error at the next line (IF (Status) RETURN). When this line is also commented out, the program runs fine.
Does anybody have any idea what might be the problem here? Thanks for any replies in advance.
Jon
I am in the process of converting a CVF project to IVF (compiler version 10.0.027 with VS2003). I am getting a run-time error in a subroutine where I check if a console has been opened or not for the application. The subroutine is as follows:
SUBROUTINE CheckConsoleAvailability()
!Local variables
LOGICAL::Status
INTEGER::fhandle
TYPE(T_CONSOLE_SCREEN_BUFFER_INFO) cinfo
!Check if a console is available
Status=GetConsoleScreenBufferInfo(fhandle,cinfo)
IF (Status) RETURN !Available, do nothing
!If not available create one
Status=AllocConsole()
fhandle=GetStdHandle(STD_OUTPUT_HANDLE)
END SUBROUTINE CheckConsoleAvailability
The subroutine is in a module. At the top of the module I have USE IFWIN. When I run the Release version of the executable it runs fine. When I run the Debug version of the executable, it runs fine as well. But when I use Debug/Start from the VS2003 I get a window that says "Unhandled exception at 0x00500a2a in processor4_0.exe: User breakpoint." at line
Status=GetConsoleScreenBufferInfo(fhandle,cinfo)
When I comment out this line and do the same (Debug/Start) this time I get the same error at the next line (IF (Status) RETURN). When this line is also commented out, the program runs fine.
Does anybody have any idea what might be the problem here? Thanks for any replies in advance.
Jon
コピーされたリンク
3 返答(返信)
- 新着としてマーク
- ブックマーク
- 購読
- ミュート
- RSS フィードを購読する
- ハイライト
- 印刷
- 不適切なコンテンツを報告
The fhandle argument of GetConsoleScreenBufferInfo is input so it needs to have a value before calling the function. Maybe it is better to use the GetConsoleWindow function.
- 新着としてマーク
- ブックマーク
- 購読
- ミュート
- RSS フィードを購読する
- ハイライト
- 印刷
- 不適切なコンテンツを報告
ggveldkamp2:
The fhandle argument of GetConsoleScreenBufferInfo is input so it needs to have a value before calling the function. Maybe it is better to use the GetConsoleWindow function.
No, it's a HANDLE, not a HWND. However, GetStdHandle(STD_OUTPUT_HANDLE) should do the job instead.
- 新着としてマーク
- ブックマーク
- 購読
- ミュート
- RSS フィードを購読する
- ハイライト
- 印刷
- 不適切なコンテンツを報告
This is probably an uninitialized variable error. See if the console window (behind the VS window most likely) has a more detailed message.