Using \n in an EDIT box(I have an error)

This is a discussion on Using \n in an EDIT box(I have an error) within the Windows Programming forums, part of the Platform Specific Boards category; I have an EDIT box. I tried to put in a \n to skip a line, but it doesn't work. ...

  1. #1
    Programming is fun, mkay?
    Join Date
    Oct 2001
    Posts
    490

    Question Using \n in an EDIT box(I have an error)

    I have an EDIT box. I tried to put in a \n to skip a line, but it doesn't work. I get:

    220 keyboard.cpp
    passing `char' to argument 2 of `strcat(char *, const char *)' lacks a cast
    Website(s): http://www16.brinkster.com/trifaze/

    E-mail: trifaze_mattu@lycos.com

    ---------------------------------
    C++ Environment: MSVC++ 6.0; Dev-C++ 4.0/4.1
    DirectX Version: 9.0b
    DX SDK: DirectX 8.1 SDK

  2. #2
    zen
    zen is offline
    of Zen Hall zen's Avatar
    Join Date
    Aug 2001
    Posts
    1,007
    Edit boxes need \r\n for a newline.
    zen

  3. #3
    Programming is fun, mkay?
    Join Date
    Oct 2001
    Posts
    490

    It still said..

    I have the code:

    strcat(getName, '\r\n');

    and it says:

    220 keyboard.cpp
    passing `int' to argument 2 of `strcat(char *, const char *)' lacks a cast


    and I tried:

    strcat(getName, "\r\n");

    and it doesn't do a new line.
    Website(s): http://www16.brinkster.com/trifaze/

    E-mail: trifaze_mattu@lycos.com

    ---------------------------------
    C++ Environment: MSVC++ 6.0; Dev-C++ 4.0/4.1
    DirectX Version: 9.0b
    DX SDK: DirectX 8.1 SDK

  4. #4
    zen
    zen is offline
    of Zen Hall zen's Avatar
    Join Date
    Aug 2001
    Posts
    1,007
    and I tried:

    strcat(getName, "\r\n");

    This should work. You'll have to post more code.

    btw, what compiler are you using?
    zen

  5. #5
    Programming is fun, mkay?
    Join Date
    Oct 2001
    Posts
    490

    Post I am using..

    I am using Mingw32 in Dev-C++
    Website(s): http://www16.brinkster.com/trifaze/

    E-mail: trifaze_mattu@lycos.com

    ---------------------------------
    C++ Environment: MSVC++ 6.0; Dev-C++ 4.0/4.1
    DirectX Version: 9.0b
    DX SDK: DirectX 8.1 SDK

  6. #6
    zen
    zen is offline
    of Zen Hall zen's Avatar
    Join Date
    Aug 2001
    Posts
    1,007
    I tried strcat(getName, "\r\n"); on Dev C++ and it inserted a newline on an Editbox, so the problem must be elsewhere in your code (is getName long enough to be appended).
    zen

  7. #7
    Just one more wrong move. -KEN-'s Avatar
    Join Date
    Aug 2001
    Posts
    3,230
    Are you sure you have a MultiLine edit?

  8. #8
    Programming is fun, mkay?
    Join Date
    Oct 2001
    Posts
    490

    Post Ok, but I have a new problem

    I got a multiline now. I forgot it. But now, I have the message. Though, when I click the button a second time, it shows the message twice, third click,message 3 times, and so on. What do Ido to reset the contents ofthe char's whenthe button is clicked?
    Website(s): http://www16.brinkster.com/trifaze/

    E-mail: trifaze_mattu@lycos.com

    ---------------------------------
    C++ Environment: MSVC++ 6.0; Dev-C++ 4.0/4.1
    DirectX Version: 9.0b
    DX SDK: DirectX 8.1 SDK

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Getting an error with OpenGL: collect2: ld returned 1 exit status
    By Lorgon Jortle in forum C++ Programming
    Replies: 6
    Last Post: 05-08-2009, 08:18 PM
  2. Making C DLL using MSVC++ 2005
    By chico1st in forum C Programming
    Replies: 26
    Last Post: 05-28-2008, 01:17 PM
  3. Avoiding Global variables
    By csonx_p in forum Windows Programming
    Replies: 32
    Last Post: 05-19-2008, 12:17 AM
  4. Using VC Toolkit 2003
    By Noobwaker in forum Windows Programming
    Replies: 8
    Last Post: 03-13-2006, 06:33 AM
  5. Connecting to a mysql server and querying problem
    By Diod in forum C++ Programming
    Replies: 8
    Last Post: 02-13-2006, 09:33 AM

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