Re: Basic question : Replacing CString when moving from MFC to Win32
From: John Sway (john_at_aol.com)
Date: 02/19/04
- Next message: Kalon Mills: "Re: Getting started writing PocketPC apps."
- Previous message: John Lathem: "Microsoft Media Player Control for PocketPC"
- In reply to: John Sway: "Basic question : Replacing CString when moving from MFC to Win32"
- Next in thread: KS: "Re: Basic question : Replacing CString when moving from MFC to Win32"
- Reply: KS: "Re: Basic question : Replacing CString when moving from MFC to Win32"
- Messages sorted by: [ date ] [ thread ]
Date: Thu, 19 Feb 2004 14:07:43 -0600
My other (related) question is: if I have a LPTSTR member in a Win32 class,
do I need to allocate it's memory manually?
For example:
If my class is :
class CPerson
{
public:
LPTSTR m_szFirstName;
}
do I have to "initiate" or allocate any memory into m_szFirstName in the
class contructor?
I am sorry for such a basic question, but I have always used CString
variables and have NO idea how to deal with strings directly.
Thanks!
"John Sway" <john@aol.com> wrote in message
news:ekOLbFy9DHA.2804@TK2MSFTNGP09.phx.gbl...
> 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!
>
>
- Next message: Kalon Mills: "Re: Getting started writing PocketPC apps."
- Previous message: John Lathem: "Microsoft Media Player Control for PocketPC"
- In reply to: John Sway: "Basic question : Replacing CString when moving from MFC to Win32"
- Next in thread: KS: "Re: Basic question : Replacing CString when moving from MFC to Win32"
- Reply: KS: "Re: Basic question : Replacing CString when moving from MFC to Win32"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|