Hi, I'm using CFV 6.5 in Windows 2000 to run an executable, and then read the screen output from that executable. Since FORTRAN only reads characters from the screen input (cursor line), I tried using some Windows SDK routines, like ReadConsoleOutput, or ReadConsoleOutputCharacter, but I can't get them to work.
Using ReadConsoleOutput, I get Error 87 (ERROR_INVALID_PARAMETER), and using ReadConsoleOutputCharacter, I'm getting Error 12 (ERROR_INVALID_ACCESS). I think my problem is with the declaration of the variables, can anyone help me on this?
The example I'm trying to follow declares chiBuffer as a CHAR_INFO structure of size 160 (two lines of 80 characters). How can I do that in FORTRAN?
Here's the code I have so far...
hStdout = GetStdHandle(STD_OUTPUT_HANDLE)
hNewScreenBuffer = CreateConsoleScreenBuffer
srctReadRect.Top = 0
srctReadRect.Left = 0
srctReadRect.Bottom = 1
srctReadRect.Right = 79
coordBufSize.Y = 2
coordBufSize.X = 80
coordBufCoord.X = 0
coordBufCoord.Y = 0
fSuccess = ReadConsoleOutput(hStdout,chiBuffer,coordBufSize,
c That's where I get Error 87
fsuccess2 = ReadConsoleOutputCharacter(hStdout,fullMessage,
c That's where I get Error 12