I have simple app that I try to compile with VC express and using the:
Microsoft platform SDK for Windows server 2003 that contains MFC and ATL.
Now I have this simple code :
CString strValue("test");
CString s = strValue.Trim();
LPCTSTR lpStr = (LPCTSTR)strValue.Trim()
that give me a compilation error : c:\dev\test.cpp(463) : error C2039: 'Trim' : is not a member of 'CString' c:\program files\microsoft platform sdk for windows server 2003 r2\include\mfc\afx.h(369) : see declaration of 'CString'
do I have a problem with the platform SDK and vc express?
You can assign C-style literal strings to a CString just as you can assign one CString object to another. Assign the value of a C literal string to a CString object. CString myString = _T("This is a test"); Assign the value of one CString to another CString object.
A CString object keeps character data in a CStringData object. CString accepts NULL-terminated C-style strings. CString tracks the string length for faster performance, but it also retains the NULL character in the stored character data to support conversion to LPCWSTR .
Advertisements. Strings are objects that represent sequences of characters. The C-style character string originated within the C language and continues to be supported within C++. This string is actually a one-dimensional array of characters which is terminated by a null character '\0'.
Visual C++ Express Edition don't has built in support for ATL and MFC (CString
is an MFC class, implemented as the shared MFC/ATL CStringT
class: documentation).
If you really can't afford the Standard Edition, you can rely on this howto to add ATL and MFC support by installing the DDK: http://www.codeproject.com/KB/MFC/MFCinVisualStudioExpress.aspx
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With