Problems with SetTextColor()

This is a discussion on Problems with SetTextColor() within the Windows Programming forums, part of the Platform Specific Boards category; I'm haveing a bit of an issue with the function SetTextColor()..and i'm pretty much lost. I'm getting the errors of ...

  1. #1
    Registered User
    Join Date
    Mar 2004
    Posts
    220

    Problems with SetTextColor()

    I'm haveing a bit of an issue with the function SetTextColor()..and i'm pretty much lost. I'm getting the errors of "invalid conversion from", and "too few arguments to function `COLORREF".

    Heres my code:
    Code:
    /*Headers for this file*/
    #include <windows.h>
    #include <conio.h>
    
    /*Namespaces*/
    using namespace std;
    
    /*Globals*/
    HANDLE m_Screen = GetStdHandle(STD_OUTPUT_HANDLE);
    HANDLE m_Keyboard = GetStdHandle(STD_INPUT_HANDLE);
    WORD m_TextColor;
    WORD m_BackgroundColor;
    
    /*Console Colors*/
    enum ConColor
    {
      ConRed = 1, ConGreen = 2, ConBlue = 4
    };
    
    int main()
    {
      char *title = "WinCon exp.";
        SetConsoleTitle(title);
      
      SetTextColor(ConRed | ConGreen | ConBlue);
      DWORD Written;
      char *write = "Hello World!";
      WriteConsole(m_Screen, write, strlen(write), &Written, NULL);
      getch();
    
    return 0;
    }
    Anyone have a clue what i'm doing wrong?
    *scratches head*..I'm kind of new to all of this stuff, just so you guys know.. starting out on windows.h stuff today.
    OS: Windows XP Pro CE
    IDE: VS .NET 2002
    Preferred Language: C++.

  2. #2
    Registered User Codeplug's Avatar
    Join Date
    Mar 2003
    Posts
    4,630
    Read this tutorial.

    gg

  3. #3
    Registered User
    Join Date
    Mar 2004
    Posts
    220
    Thank you codeplug, that helps alot.
    OS: Windows XP Pro CE
    IDE: VS .NET 2002
    Preferred Language: C++.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. No clue how to make a code to solve problems!
    By ctnzn in forum C Programming
    Replies: 8
    Last Post: 10-16-2008, 02:59 AM
  2. C Pointers Problems
    By mhelal in forum C Programming
    Replies: 8
    Last Post: 01-10-2007, 05:35 AM
  3. String Manipulation problems -_-
    By Astra in forum C Programming
    Replies: 5
    Last Post: 12-13-2006, 04:48 PM
  4. Rendering problems (DirectX?)
    By OnionKnight in forum Tech Board
    Replies: 0
    Last Post: 08-17-2006, 12:17 PM
  5. DJGPP problems
    By stormswift in forum C Programming
    Replies: 2
    Last Post: 02-26-2002, 03:35 PM

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