1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

conversion of CString to LPWSTR

Discussion in 'MFC' started by rinuvc, Mar 16, 2008.

  1. rinuvc

    rinuvc New Member

    Joined:
    Mar 12, 2008
    Messages:
    8
    Likes Received:
    0
    Trophy Points:
    0
    hi
    every body i have got a problem in my application.

    i need to convert CString to LPWSTR

    i have tried the code below but its not working

    CString m_StructureDetails = _T("this is a CString ");

    int len = m_StructureDetails.GetLength();
    LPSTR structValue = LPSTR( m_StructureDetails.GetBuffer(len));
    m_StructureDetails.ReleaseBuffer();

    as well as this


    USES_CONVERSION;

    LPWSTR structureValues = A2W(m_StructureDetails);

    Can any body help me ...

    thanks in advance..
     

Share This Page