Re: Using CString on a platform without MFC or OLE - Howto?



I'm converting a bunch of Win32 code.
The existing code uses the STL and CString, but not MFC or ATL.
It would be easier to write my own CString class than to rewrite the
existing code, and I might have to do that but I'd rather check here first.

Tom.

"Paul G. Tobey [eMVP]" wrote:

> "Don't use CString" is my first suggestion. What's wrong with just using an
> array of TCHARs? If you feel that you must use the full power of C++, write
> your own String class. It's not super difficult.
>
> Paul T.
>
> "Qwavel" <Qwavel@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
> news:FE40285C-4C0C-4907-8596-1F9BD1AD0228@xxxxxxxxxxxxxxxx
> >I need some sort of CString, but my WinCE platform doesn't support MFC and
> > doesn't support OLE so I can't use the ATL version of CString.
> >
> > If I try to include "cstringt.h" or "atlstr.h" then I get an error that
> > explains that I can't because "This Windows CE SDK does not support
> > mini-COM
> > with OLE...".
> >
> > Why does CString depend on OLE?
> >
> > Normally I would use CStdString.h which is a great CString replacement
> > that
> > works (almost) everywhere. But this class depends on the standard library
> > and the WinCE library is non-conformant (it is missing locale) so that
> > class
> > doesn't work.
> >
> > Any suggestions?
> >
> > Thanks.
>
>
>
.



Relevant Pages

  • Re: MFC Interview Tests
    ... None of them are an MFC question. ... How would you implement user-defined messages in an MFC app? ... Why don't you need LPCTSTR casts to pass a CString to most API calls? ... Asynchronous sockets in a single separate thread ...
    (microsoft.public.vc.mfc)
  • Re: string class and UNICODE?
    ... CString - the library I'm working on had previously used just this ... if you don't want any dependency on either ATL or MFC, ...
    (microsoft.public.vc.language)
  • Re: new ...delete not working
    ... CString is now pretty much decoupled from MFC and is rather part of ATL. ... >> On the downside you can't use them in ATL without pulling in other ...
    (microsoft.public.vc.mfc)
  • Re: Sorry - basic Q about using char[] instead of CString
    ... I've got a call to an external DLL I'm using LoadLibrary to get. ... lpFUNCTION MyFunc(CString p1, CString p2, short* retVal, CString* retText) ... these would be better declarations for an MFC interface. ...
    (microsoft.public.vc.mfc)
  • Re: Parameter of dlls function
    ... The type of my local variable is CString but both exe and dll use the same ... MFC version. ...
    (microsoft.public.vc.mfc)