Click here to Skip to main content
15,926,703 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: error C2065/error C3861: 'm_nBackStyle': identifier not found, even.... Pin
vic1200016-Aug-05 13:56
vic1200016-Aug-05 13:56 
GeneralRe: error C2065/error C3861: 'm_nBackStyle': identifier not found, even.... Pin
Christian Graus16-Aug-05 14:02
protectorChristian Graus16-Aug-05 14:02 
GeneralChanging TAPI modem modes Pin
andy18015-Aug-05 10:56
andy18015-Aug-05 10:56 
QuestionCString::GetLength(), what does it in fact return? Pin
misterbear15-Aug-05 7:54
misterbear15-Aug-05 7:54 
AnswerRe: CString::GetLength(), what does it in fact return? Pin
David Crow15-Aug-05 8:46
David Crow15-Aug-05 8:46 
GeneralRe: CString::GetLength(), what does it in fact return? Pin
Graham Bradshaw15-Aug-05 9:08
Graham Bradshaw15-Aug-05 9:08 
GeneralRe: CString::GetLength(), what does it in fact return? Pin
David Crow15-Aug-05 9:27
David Crow15-Aug-05 9:27 
GeneralRe: CString::GetLength(), what does it in fact return? Pin
Jose Lamas Rios15-Aug-05 9:11
Jose Lamas Rios15-Aug-05 9:11 
DavidCrow wrote:
It returns the number of bytes in the object. For Unicode, this is twice the number of characters.

Actually, for Unicode, the returned length is the count of WCHARs. In other words, it's always the length in TCHARs (bytes for non-Unicode, WCHARs for Unicode). So, CString(_T("Four")).GetLength() will always return 4, regardless of Unicode settings.

The semantics for CString::GetLength() are the same as for the lstrlen[^] function, which is used internally by CString implementation. For instance, see the implementation for CString::ReleaseBuffer() (VC 6.0)
void CString::ReleaseBuffer(int nNewLength)
{
   CopyBeforeWrite();  // just in case GetBuffer was not called

   if (nNewLength == -1)
      nNewLength = lstrlen(m_pchData); // zero terminated

   ASSERT(nNewLength <= GetData()->nAllocLength);
   GetData()->nDataLength = nNewLength;
   m_pchData[nNewLength] = '\0';
}



--
jlr
http://jlamas.blogspot.com/[^]
AnswerRe: CString::GetLength(), what does it in fact return? Pin
Tim Smith15-Aug-05 13:30
Tim Smith15-Aug-05 13:30 
GeneralRe: CString::GetLength(), what does it in fact return? Pin
misterbear15-Aug-05 20:05
misterbear15-Aug-05 20:05 
Generalfirewall by-passing Pin
avi-wildthing15-Aug-05 7:02
avi-wildthing15-Aug-05 7:02 
GeneralRe: firewall by-passing Pin
Rage15-Aug-05 7:04
professionalRage15-Aug-05 7:04 
GeneralRe: firewall by-passing Pin
avi-wildthing15-Aug-05 7:40
avi-wildthing15-Aug-05 7:40 
GeneralRe: firewall by-passing Pin
Bob Stanneveld15-Aug-05 10:23
Bob Stanneveld15-Aug-05 10:23 
GeneralRe: firewall by-passing Pin
avi-wildthing15-Aug-05 15:53
avi-wildthing15-Aug-05 15:53 
GeneralRe: firewall by-passing Pin
ThatsAlok15-Aug-05 18:27
ThatsAlok15-Aug-05 18:27 
GeneralRe: firewall by-passing Pin
fat_boy19-Aug-05 4:42
fat_boy19-Aug-05 4:42 
GeneralHooking Pin
celllllllll15-Aug-05 6:27
celllllllll15-Aug-05 6:27 
GeneralRe: Hooking Pin
Rage15-Aug-05 6:51
professionalRage15-Aug-05 6:51 
GeneralRe: Hooking Pin
celllllllll15-Aug-05 11:16
celllllllll15-Aug-05 11:16 
GeneralRe: Hooking Pin
Rage15-Aug-05 20:34
professionalRage15-Aug-05 20:34 
GeneralRe: Hooking Pin
celllllllll16-Aug-05 7:15
celllllllll16-Aug-05 7:15 
GeneralRe: Hooking Pin
celllllllll15-Aug-05 11:32
celllllllll15-Aug-05 11:32 
GeneralUninitialized pointer Pin
valerie9915-Aug-05 5:58
valerie9915-Aug-05 5:58 
GeneralRe: Uninitialized pointer Pin
David Crow15-Aug-05 6:27
David Crow15-Aug-05 6:27 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.