Thread: WriteConsole

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


    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.

    BOOL WriteConsole(
      HANDLE hConsoleOutput,
      const VOID* lpBuffer,
      DWORD nNumberOfCharsToWrite,
      LPDWORD lpNumberOfCharsWritten,
      LPVOID lpReserved
    [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

    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
    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, 03:36 PM