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

Thread: Convert TCHAR to CString

  1. #1
    Join Date
    Aug 2000
    Location
    Malaysia
    Posts
    1

    Convert TCHAR to CString

    I have a TCHAR and I would like to convert them into CString. I tried to use class member CString but that's can't work also..what shall I do..?

    int max, i;
    TCHAR ch[max];//read from text file
    CString mystr, mstr;

    for (i=0; i<max; i++)
    { CString mystr(ch[i], 1);
    mstr += mystr;
    }

    cout <<mstr <<endl;

    I think it's only an easy question...so there will be an answer to help me..:]



  2. #2
    Join Date
    Aug 2000
    Location
    Seoul, Korea
    Posts
    6

    Re: Convert TCHAR to CString

    I'm korean. So i can't speak english very well..^^
    try like that!
    CString temp;
    char * temp1= "Test";
    temp = temp1;
    Regards....




  3. #3
    Join Date
    Mar 2000
    Location
    Bangalore,India
    Posts
    776

    Re: Convert TCHAR to CString

    hi
    after u read "ch" from file u can directly assign it to CString.
    Ex:
    TCHAR ch[10]="Some Text From File";
    CString str=ch;

    Regards
    SKP

    Be sure to rate answers if it helped, to encourage them.

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