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

Thread: CString + CString

  1. #1
    Join Date
    Jun 2013
    Posts
    21

    CString + CString

    How can I join two cstring


    C:\USERS\****\Desktop


    and

    \


    TO MAKE IT C:\USERS\****\Desktop\

  2. #2
    GCDEF is offline Elite Member Power Poster
    Join Date
    Nov 2003
    Location
    Florida
    Posts
    12,204

    Re: CString + CString

    Did you read the CString documentation? It seems pretty obvious to me.

    http://msdn.microsoft.com/en-us/libr...=vs.60%29.aspx

  3. #3
    Arjay's Avatar
    Arjay is offline Moderator / MS MVP Power Poster
    Join Date
    Aug 2004
    Posts
    11,440

    Re: CString + CString

    What have you tried?

  4. #4
    Join Date
    Jun 2013
    Posts
    21

    Re: CString + CString

    I tried

    Code:
    CString backlash = "\";
     CString whatever = m_path + backlash;
    it takes backlash as a new line though




    without adding the \ it will be a path that does not work

    example.. C:\Users\******\DesktopFile.cpp

    I need C:\Users\******\Desktop\File.cpp
    Last edited by vaas; July 1st, 2013 at 01:33 PM.

  5. #5
    Join Date
    Jun 2013
    Posts
    21

    Re: CString + CString

    for this error

    error C2001: newline in constant


    instead of using one \ I used \\ and it works now

  6. #6
    ovidiucucu's Avatar
    ovidiucucu is offline Moderator/Reviewer Power Poster
    Join Date
    Feb 2003
    Location
    Iasi - Romania
    Posts
    8,058

    Re: CString + CString

    Quote Originally Posted by vaas View Post
    for this error

    error C2001: newline in constant


    instead of using one \ I used \\ and it works now
    Cool!
    Wasn't it a little detail to be clearly shown it in the OP?
    Or you simply want to test us about guessing Escape Sequences?
    Ovidiu Cucu
    "When in Rome, do as Romans do."
    Visit: Microsoft Virtual Academy
    Follow: https://twitter.com/#!/ovidiucucu
    My blog: http://codexpert.ro/blog/author/ovidiu-cucu/

  7. #7
    Join Date
    Jun 2013
    Posts
    21

    Re: CString + CString

    No, im not testing anyone..but I figured out the problem..and I was posting it ...maybe incase if someone has the same problem

  8. #8
    ovidiucucu's Avatar
    ovidiucucu is offline Moderator/Reviewer Power Poster
    Join Date
    Feb 2003
    Location
    Iasi - Romania
    Posts
    8,058

    Re: CString + CString

    Quote Originally Posted by vaas View Post
    No, im not testing anyone..but I figured out the problem..and I was posting it ...maybe incase if someone has the same problem
    Well, then write a book.
    Or, a little bit better, learn first how to ask a question.
    Ovidiu Cucu
    "When in Rome, do as Romans do."
    Visit: Microsoft Virtual Academy
    Follow: https://twitter.com/#!/ovidiucucu
    My blog: http://codexpert.ro/blog/author/ovidiu-cucu/

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Windows Mobile Development Center


Click Here to Expand Forum to Full Width

This is a CodeGuru survey question.


Featured


HTML5 Development Center