- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
Link Copied
3 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
This is probably an uninitialized variable error. See if the console window (behind the VS window most likely) has a more detailed message.

Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page