CString under VC++ 7.0 
Author Message
 CString under VC++ 7.0

How come I can not do the following anymore?

str = CString::CString((char *)pBuff,iCount);

I get the following error:
----------------------------
error C2039: 'CString' : is not a member
of 'ATL::CStringT<BaseType,StringTraits>'
        with
        [
            BaseType=char,

StringTraits=StrTraitMFC<char,ATL::ChTraitsCRT<char>>
        ]
--------------------------------

However in the documentation is a implementation:

CStringT(
   const XCHAR* pch,
   int nLength
);

but can not use it beacuse XCHAR is undefined???

thnax
Daveed



Tue, 22 Feb 2005 03:47:42 GMT  
 CString under VC++ 7.0

Quote:

> How come I can not do the following anymore?

> str = CString::CString((char *)pBuff,iCount);

Why do you not just do this:

str = CString((char *)pBuff,iCount);

Quote:
> but can not use it beacuse XCHAR is undefined???

I think you'll find that XCHAR is defined just fine.  It will probably be
'char', in your situation.

Will



Tue, 22 Feb 2005 04:43:22 GMT  
 CString under VC++ 7.0

Quote:

> How come I can not do the following anymore?

> str = CString::CString((char *)pBuff,iCount);

That looks like a function call that directly references the
constructor - which isn't supposed to work under any circumstances,
regardless of whether there's a constructor named "CString".


Tue, 22 Feb 2005 05:09:39 GMT  
 CString under VC++ 7.0
Well it worked under VC 6.0 so I guess it was a C++ non-
compliante feature of that compiler. I changed the
CString::CString(..) call to CString(..) and all is fine
now!

thanx
Daveed

Quote:
>-----Original Message-----

>> How come I can not do the following anymore?

>> str = CString::CString((char *)pBuff,iCount);

>Why do you not just do this:

>str = CString((char *)pBuff,iCount);

>> but can not use it beacuse XCHAR is undefined???

>I think you'll find that XCHAR is defined just fine.  It
will probably be
>'char', in your situation.

>Will

>.



Tue, 22 Feb 2005 05:47:22 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. Ugly ATLMFC 7.0 Bugs in CArchive serialisation of CString

2. Bugs in MFC/ATL 7.0 CString operators (100% recreatable)

3. BUG in CString serialization in MFC 7.0

4. BUG in MFC 7.0 CString

5. Ugly ATLMFC 7.0 Bugs in CArchive serialisation of CString

6. Bugs in MFC/ATL 7.0 CString operators (100% recreatable)

7. How to use VC 7.0 C++ compiler from VC 6.0 IDE

8. a bug in VC 7.0 (but not in VC 6.0)

9. Slower compilation with VC Net 2003 (7.1) when compared to VC Net 7.0

10. Preserving writable server cursor after rollback (7.0, vc++, CDatabase/CRecordset)

11. Ambiguity error (vc++ 7.0)

12. Where is leak from? stl vector vc++ 7.0

 

 
Powered by phpBB® Forum Software