Basic question : Replacing CString when moving from MFC to Win32

From: John Sway (john_at_aol.com)
Date: 02/19/04


Date: Thu, 19 Feb 2004 13:48:30 -0600

We are porting one of our MFC apps to Pocket PC and Smartphone devices. Due
to disk and memory constraints, we cannot use MFC for these platforms.

So I have to convert our MFC-based objects into plain Win32 classes. My
question is what string type do you use for replacing MFC's CString? For
example, if my MFC class is :

class CPerson : public CObject
{
    CString m_strFirstName;
    CString m_strLastName;
}

How would I write this in Win32? I realize, the CObject will have to go.

Regarding the strings, will they be defined as LPCTSTR or LPTSTR? Does it
make any difference? Also, is there any "base" class like CObject in Win32
that will help when serializing our data?

Thanks!



Relevant Pages

  • Basic question : Replacing CString when moving from MFC to Win32
    ... We are porting one of our MFC apps to Pocket PC and Smartphone devices. ... So I have to convert our MFC-based objects into plain Win32 classes. ... question is what string type do you use for replacing MFC's CString? ... the CObject will have to go. ...
    (microsoft.public.pocketpc.developer)
  • Re: Basic question : Replacing CString when moving from MFC to Win32
    ... But in MFC7.x, CString does not depend on MFC. ... >> So I have to convert our MFC-based objects into plain Win32 classes. ... the CObject will have to go. ...
    (microsoft.public.vc.mfc)
  • Re: Basic question : Replacing CString when moving from MFC to Win32
    ... But in MFC7.x, CString does not depend on MFC. ... >> So I have to convert our MFC-based objects into plain Win32 classes. ... the CObject will have to go. ...
    (microsoft.public.pocketpc.developer)
  • Re: Inheritance and MFC
    ... But it cannot interact with the mouse or display unless ... So CObject buys nothing. ... I didn't see a need to inherit from CWnd, since all I needed was Serialization. ... BUt either you are using MFC, in which case adding CWnd doesn't matter, or it does not use ...
    (microsoft.public.vc.mfc)
  • Re: Inheritance and MFC
    ... So CObject buys nothing. ... I didn't see a need to inherit from CWnd, since all I needed was Serialization. ... Familiarizing myself with the interworkings of MFC. ...
    (microsoft.public.vc.mfc)