1. We have moved from vBulletin to XenForo and you are viewing the site in the middle of the move. Though the functional aspect of everything is working fine, we are still working on other changes including the new design on Xenforo.
    Dismiss Notice

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