News:

The new Release 25.03 is out! You can download binaries for Windows and many major Linux distros here .

Main Menu

About CC: typedef problem

Started by Loaden, June 03, 2009, 07:53:16 AM

Previous topic - Next topic

Loaden

#ifndef _ATL_CSTRING_NO_CRT
typedef CStringT< wchar_t, StrTraitATL< wchar_t, ChTraitsCRT< wchar_t > > > CAtlStringW;
typedef CStringT< char, StrTraitATL< char, ChTraitsCRT< char > > > CAtlStringA;
typedef CStringT< TCHAR, StrTraitATL< TCHAR, ChTraitsCRT< TCHAR > > > CAtlString;
#else  // _ATL_CSTRING_NO_CRT
typedef CStringT< wchar_t, StrTraitATL< wchar_t > > CAtlStringW;
typedef CStringT< char, StrTraitATL< char > > CAtlStringA;
typedef CStringT< TCHAR, StrTraitATL< TCHAR > > CAtlString;
#endif  // _ATL_CSTRING_NO_CRT

#ifndef _AFX
typedef CAtlStringW CStringW;
typedef CAtlStringA CStringA;
typedef CAtlString CString;
#endif


typedef CAtlString CString;
Not work!
but CAtlString is ok!

ollydbg

What do you mean by "not work"? :D
Please give a more specific details.
If some piece of memory should be reused, turn them to variables (or const variables).
If some piece of operations should be reused, turn them to functions.
If they happened together, then turn them to classes.

Loaden

Quote from: ollydbg on June 03, 2009, 08:05:30 AM
What do you mean by "not work"? :D
Please give a more specific details.
CC can't show the parser word. nothing!

ollydbg

The complex "template" typedef before

typedef CAtlStringW CStringW;
typedef CAtlStringA CStringA;
typedef CAtlString CString;

may cause the problem.

The parser may failed parsing these template declaration.
If some piece of memory should be reused, turn them to variables (or const variables).
If some piece of operations should be reused, turn them to functions.
If they happened together, then turn them to classes.