1. Computer problem? Tech Support Guy is completely free -- paid for by advertisers and donations. Click here to join today! If you're new to Tech Support Guy, we highly recommend that you visit our Guide for New Members.

Conversion of CString to string VC++/C++

Discussion in 'Software Development' started by calculus87, Oct 1, 2003.

Thread Status:
Not open for further replies.
Advertisement
  1. calculus87

    calculus87 Thread Starter

    Joined:
    Sep 4, 2003
    Messages:
    34
    Hello,
    Here is my question. I have a program which has a VC++ frontend. While the VC++ program is running it calls a C++ program in the background. The C++ program returns a string. Now I need to save that string. But the only way I know how(which does not work) is through CString. So my question is this, is there any way so save the returned string? Thanks for taking a look.
    Sincerely,
    Ronald
     
  2. Anne Troy

    Anne Troy

    Joined:
    Feb 14, 1999
    Messages:
    11,746
    First Name:
    Anne
    Hi, Calc. I moved your Q to Development, which is where most programming answers can be gotten.

    :)
     
  3. calculus87

    calculus87 Thread Starter

    Joined:
    Sep 4, 2003
    Messages:
    34
    Okay,
    I did not realize that. Thanks a bunck.
    ~Ronald
     
  4. Guy

    Guy

    Joined:
    Feb 19, 1999
    Messages:
    260
    Did you want a conversion from CString to string? or string to CString?

    here is string to CString:
    Code:
    string s = "hello string";
    CString c = s.c_str();
    here is CString to string:
    Code:
    CString c = "hello CString";
    string s = c;
     
  5. calculus87

    calculus87 Thread Starter

    Joined:
    Sep 4, 2003
    Messages:
    34
    ahhh, thanks a bunch. Works very nicely
     
  6. Sponsor

As Seen On
As Seen On...

Welcome to Tech Support Guy!

Are you looking for the solution to your computer problem? Join our site today to ask your question. This site is completely free -- paid for by advertisers and donations.

If you're not already familiar with forums, watch our Welcome Guide to get started.

Join over 733,556 other people just like you!

Loading...
Similar Threads - Conversion CString string
  1. edjon2000
    Replies:
    0
    Views:
    378
Thread Status:
Not open for further replies.

Short URL to this thread: https://techguy.org/168855

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice