Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7429905
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T09:03:20+00:00 2026-05-29T09:03:20+00:00

I am trying to call the GetConsoleScreenBufferInfoEx function from a console application. If it

  • 0

I am trying to call the GetConsoleScreenBufferInfoEx function from a console application. If it matters, the application is a 32 bit application running on 64 bit Windows 7. The language is RealBasic.

I believe I have defined all the structures correctly, and the buffer output handle works for every other API function that is being called:

  Declare Function GetConsoleScreenBufferInfoEx Lib "Kernel32" (cHandle As Integer, ByRef info As CONSOLE_SCREEN_BUFFER_INFOEX) As Boolean
  Declare Function GetLastError Lib "Kernel32" () As Integer
  Declare Function GetStdHandle Lib "Kernel32" (hIOStreamType As Integer) As Integer

  Const STD_OUTPUT_HANDLE = -11
  Dim stdHandle As Integer = GetStdHandle(STD_OUTPUT_HANDLE)

  Dim err As Integer
  Dim info As CONSOLE_SCREEN_BUFFER_INFOEX

  If GetConsoleScreenBufferInfoEx(stdHandle, info) Then
    Break
  Else
    err = GetLastError  //Always 87, Invalid parameter
    Break
  End If

Structures:

Structure CONSOLE_SCREEN_BUFFER_INFOEX
  cbSize As Integer
  dwSize As COORD
  CursorPosition As COORD
  Attribute As UInt16
  srWindow As SMALL_RECT
  MaxWindowSize As COORD
  PopupAttributes As UInt16
  FullScreenSupported As Boolean
  ColorTable(15) As UInt32


Structure COORD
  X As UInt16
  Y As UInt16


Structure SMALL_RECT
  Left As UInt16
  Top As UInt16
  Right As UInt16
  Bottom As UInt16

I’ve gone over this 20 times and nothing looks wrong to me. I’ve used the COORD and SMALL_RECT structures many times before, so I don’t think I made any translation errors on them. The CONSOLE_SCREEN_BUFFER_INFOEX structure, however, is seeing its first use by me here, and I sense that the error lies somewhere in my translation of it.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-29T09:03:21+00:00Added an answer on May 29, 2026 at 9:03 am

    You need to set the cbSize parameter of the CONSOLE_SCREEN_BUFFER_INFOEX before you send it in. GetConsoleScreenBufferInfoEx will check that it is the correct size and that’s why it’s returning an invalid parameter.

    So before the call to GetConsoleScreenBufferInfoEx add:

    info.cbSize = 96
    

    Or better yet Real Basic does allow you to access the size of the structure:

    info.cbSize = GetConsoleScreenBufferInfoEx.Size

    Which should handle the calculation for you.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to call a user-defined MATLAB function from a C application, but I'm
I am trying to call a c# function from f# where the c# function
I'm trying to call Calendar from my simple application in iPhone. all sample out
In the following I am trying call action script function from js function. What
Am trying to call a JS script from a function library in another script.
I am trying to call a function in another .php file from this one
I am trying to call the following function from a static method. File directory
Hi im trying call this function from an element, but the element id is
I'm trying to call a service from a activity: When I'm running the program
I'm trying to call c functions from python, I have the following code in

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.