Home > Software engineering >  Cstrings: : GetLength (); How much is the value returned from this function?
Cstrings: : GetLength (); How much is the value returned from this function?

Time:09-22

 
Const int GetLength () throw ()
{
Return (GetData () - & gt; NDataLength);
}
Struct CStringData
{
IAtlStringMgr * pStringMgr;//the String manager for this CStringData
Int nDataLength;//Length of currently informs the data in XCHARs (not o terminating null)
Int nAllocLength;//Length of allocated data in XCHARs (not o terminating null)
Long nRefs;//the Reference count: negative==locked
//XCHAR data [nAllocLength + 1]//A CStringData is always followed in memory by the actual array of character data
}


2.0 this is I use Rich Edit controls, the length of the string inside want to get this, but feel there is something wrong with the old
How much is the Rich Edit the maximum length of 2.0?

CodePudding user response:

CRichEditCtrl: : GetLimitText
Long GetLimitText () const;

The Return Value

The current text limit, in bytes, for this CRichEditCtrl object.

Few

Call this member function to get the text limit for this CRichEditCtrl object. The text limit is the maximum amount of text, in bytes, of the rich edit control can accept.

CodePudding user response:

To edit the
//otherwise only 0 XFFFFF=1048575 bytes can be show!
GetEditCtrl (.) SetLimitText (0 x00400000);

CodePudding user response:

Use the GetTextLength () m_RichEdit. GetTextLength ();
CRichEditCtrl: : GetTextLength ()

CodePudding user response:

Cstrings: : GetLength () some egg pain,
If it is a multi-byte character set, returns the string of bytes (such as "China 123", return to 7)
Unicode is returned if the number of characters (such as "China's 123", return to 5)

CodePudding user response:

Retrieve the length of the text, in character, this CRichEditCtrl object, not including the termination of the null character),
  • Related