WriteConsole

This is a discussion on WriteConsole within the Windows Programming forums, part of the Platform Specific Boards category; I'm going to be writing a console game in which I need to print out chars very quickly. The funtion ...

  1. #1
    Kiss the monkey. CodeMonkey's Avatar
    Join Date
    Sep 2001
    Posts
    920

    WriteConsole

    I'm going to be writing a console game in which I need to print out chars very quickly. The funtion I destined for this task is WriteConsole(), because I found it to be the fastest. My question is- there is one parameter in that function that points to a value and writes in how many chars were written. I have no use for this feature. Is it wrong to have it point to a useless, global vaiable every time? Passing NULL causes an error.

    Code:
    BOOL WriteConsole(
      HANDLE hConsoleOutput,
      const VOID* lpBuffer,
      DWORD nNumberOfCharsToWrite,
      LPDWORD lpNumberOfCharsWritten,
      LPVOID lpReserved
    );
    lpNumberOfCharsWritten
    [out] Pointer to a variable that receives the number of TCHARs actually written.
    "If you tell the truth, you don't have to remember anything"
    -Mark Twain

  2. #2
    &TH of undefined behavior Fordy's Avatar
    Join Date
    Aug 2001
    Posts
    5,789

    Re: WriteConsole

    I always have it pointing to a dummy variable....cant hurt if you dont care about the success of the function call

  3. #3
    It's full of stars adrianxw's Avatar
    Join Date
    Aug 2001
    Posts
    4,831
    If you want to output a number of the same character, use FillConsoleOutputCharacter(), look it up, or it is covered in part 2 of my tutorial here.
    Wave upon wave of demented avengers march cheerfully out of obscurity unto the dream.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Problem with WriteConsole()
    By maxhavoc in forum C++ Programming
    Replies: 2
    Last Post: 06-23-2004, 04:36 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21