WebFeb 27, 1999 · Of course to free the block of memory, CString cannot free m_pchData, but instead frees (BYTE*)GetData (); GetData () returns ( (CStringData*)m_pchData)-1. … Weband put the pointer to CStringData (which is an internal class that stores information like reference counts to string, etc.) *before* the m_pszData member of CSimpleStringT. In fact, you can read that CSimpleStringT::GetData does an "unusual" (but meaningful) cast like this: CStringData* GetData () const throw () {
CString In A Nutshell Developer.com
WebApr 23, 2003 · CStringData* GetData() const throw() { return( reinterpret_cast< CStringData* >( m_pszData )-1 ); } it breaks at this point, in the file atlsimpstr.h 0perand 4/23/2003 WebCStringData* pOldData = GetData (); LPTSTR pstr = m_pchData; AllocBuffer (nNewLength); memcpy (m_pchData, pstr, (pOldData-> nDataLength + 1 )* sizeof (TCHAR)); CString::Release (pOldData); } // move existing bytes down memcpy (m_pchData + nIndex + 1, m_pchData + nIndex, (nNewLength-nIndex)* sizeof (TCHAR)); m_pchData … bunnings trade account application form
How to pass a CString variable through a LPARAM or WPARAM?
This class represents the data of a string object. See more WebMar 27, 2024 · The only data member m_pszData points into a structure of type CStringData, that consists of an initial sequence of constant size, storing the bookkeeping information, immediately followed by an array of characters of length nAllocLength + 1. m_pszData points at this array, and the additional data is retrieved through pointer … WebApr 8, 2013 · CSimpleStringT& operator= (_In_ const CSimpleStringT& strSrc) { CStringData* pSrcData = strSrc.GetData (); CStringData* pOldData = GetData (); if ( … bunnings trade account application form nz