make two CStrings equal in length



Hi,

I have two CString's. CString 1 has _T("abcdefg"). I want to make CString 2 as empty but has the same (or close) lenght as CString 1's on the screen. Is it possible? Assuming that I already have a pointer to CDC. Please help. Thanks.

Tony
.



Relevant Pages

  • Re: CString Speed and compiler optimization
    ... semantics is hidden in the constructor and assignment operators for CString, ... there is no way to tell that the original contents were empty already. ... >Can you tell me if the compiler optimization remove this affectation? ...
    (microsoft.public.vc.mfc)
  • Re: CString Speed and compiler optimization
    ... Empty checks for a few things and does a bit of stuff to release, or not, ... why this interest in what the optimiser does. ... has no way to know that a CString is initialised, in its constructor, to ...
    (microsoft.public.vc.mfc)
  • Re: ATL CString losing count
    ... CString faultydestruct = CString; ... so I guess CString only likes char* ... The CString member's destructor should run before the object being ... Try the explicit Empty call and see if that exposes the same behavior. ...
    (microsoft.public.vc.atl)
  • Re: CString Memory Leak
    ... Ich habe die Variable CString mit _declspecgerade deshalb ... Ich kann sie deshalb nicht in der DLL auf Empty setzen. ... wo mache ich das im Hauptprogramm? ...
    (microsoft.public.de.vc)
  • Re: Determining if CString is Empty ?
    ... Robert A. wrote: ... CString initializes empty so it is unnecessary. ... Best, Dan. ...
    (microsoft.public.vc.mfc)