CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 5 of 5
  1. #1
    Join Date
    Jun 2007
    Location
    .NET 3.5 Beta SP1, Visual Basic 2008 Express
    Posts
    225

    [RESOLVED] Size of Std Output

    When you create a c++ console application, there is already a Std output buffer in the console window created. Is there anyway to get the size of that buffer or its handle so I could manipulate it with functions like WriteConsoleOutputCharacter?
    Microsoft Visual Basic 2008 Express Edition
    .NET Framwork 3.5 Beta SP1

  2. #2
    Join Date
    Jun 2005
    Posts
    1,255

    Smile Re: Size of Std Output

    I don't think stdout is a buffer. It is a handle for a pseudo-file. I talk of stdout, like in
    Code:
    fprintf(stdout, "Hello, world!");

  3. #3
    Join Date
    Jun 2007
    Location
    .NET 3.5 Beta SP1, Visual Basic 2008 Express
    Posts
    225

    Re: Size of Std Output

    Quote Originally Posted by olivthill
    I don't think stdout is a buffer. It is a handle for a pseudo-file. I talk of stdout, like in
    Code:
    fprintf(stdout, "Hello, world!");
    So there's no console buffer? Even if it is some sort of pseudo-file, given the console buffer you can take over that buffers standard output and put what you want there. I guess my question really is, what's the handle for the initial Console Buffer in a newly created console window?
    Microsoft Visual Basic 2008 Express Edition
    .NET Framwork 3.5 Beta SP1

  4. #4
    Join Date
    Dec 2004
    Location
    Poland
    Posts
    1,165

    Re: Size of Std Output

    If you mean Windows, and you use WinAPI, there is a set of console functions: http://msdn.microsoft.com/en-us/libr...73(VS.85).aspx . You can use GetStdHandle to receive handle to an input/output device, or GetConsoleScreenBufferInfo[Ex] to receive console buffer info.

    If you do not mean Windows, or not WinAPI, then I do not know.

    Cheers
    B+!
    'There is no cat' - A. Einstein

    Use [code] [/code] tags!

    Did YOU share your photo with us at CG Members photo gallery ?

  5. #5
    Join Date
    Jun 2007
    Location
    .NET 3.5 Beta SP1, Visual Basic 2008 Express
    Posts
    225

    Re: Size of Std Output

    Quote Originally Posted by Hobson
    If you mean Windows, and you use WinAPI, there is a set of console functions: http://msdn.microsoft.com/en-us/libr...73(VS.85).aspx . You can use GetStdHandle to receive handle to an input/output device, or GetConsoleScreenBufferInfo[Ex] to receive console buffer info.

    If you do not mean Windows, or not WinAPI, then I do not know.

    Cheers
    I knew about those, but I should've thought more about GetStdHandle and GetConsoleScreenBufferInfo. My solution was to do this:

    Code:
    HANDLE hMap = GetStdHandle(STD_OUTPUT_HANDLE);
    Which works, so thanks to everyone for their help.
    Microsoft Visual Basic 2008 Express Edition
    .NET Framwork 3.5 Beta SP1

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured