CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 5 of 5

Thread: easy one

  1. #1
    Join Date
    Sep 1999
    Location
    Ireland
    Posts
    38

    easy one

    I'm getting little blocks when I write \n or \r to a text file, I've fixed this before, but can't remember how! Anyhelp? BTW, I'm copying the string "hello \n\r" from a
    CString
    to a
    char cBuf[100]
    using strcpy
    Cheers
    Steve


  2. #2
    Join Date
    Sep 1999
    Location
    Pakistan
    Posts
    22

    Re: easy one

    Hello,

    use memcpy() instead of strcpy()

    cheers,

    Tufail Khan


  3. #3
    Join Date
    Sep 1999
    Location
    Ireland
    Posts
    38

    Re: easy one

    would using .AnsiToOem() help?


  4. #4
    Join Date
    Sep 1999
    Location
    Pakistan
    Posts
    22

    Re: easy one

    friend ! could not get ur question? whats problem using .AnsiToOem().

    Its purpose is to convert all the characters in this CString object from the ANSI character set to the OEM character set.

    what else do u want to know?

    Tufail Khan




  5. #5
    Join Date
    May 1999
    Location
    West Sussex, England
    Posts
    1,939

    Re: easy one

    Your problem might be you are doing new line then line feed, when you should be doing line feed then new line return. Swap the /n/r to /r/n.

    Notepas and text processors expect the pair of characters in a certain order, if they don't get them in that order you get the little black squares.

    HTH



    Roger Allen aka [CB]RIGamortis, the quake2 player.
    Please use meaningful question titles - "Help me" does not let me know whether I can help with your question, and I am unlikely to bother reading it.
    Please remember to rate useful answers. It lets us know when a question has been answered.

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