Windows XP CString problems with porting VC++ 6 to VC++ 7

Joined
Dec 1, 2005
Messages
2
Reaction score
0
I am trying to port some VC++6 code to VC++7 (VS2003), & met the following compilation error when compiling my old code in .NET:

error 2371:'CString': redefinition; different basic types
in c:\program files\microsoft visual studio .net 2003\vc7\atlmfc\include\afxstr.h

After some time on the Web, I found out that CString in VC++7 has been declared as a template class (thus breaking legacy code using CString written in VC++6). In afxstr.h, there's this statement which does this:
typedef ATL::CStringT<TCHAR, StrTraitMFC<TCHAR>> CString;

Apparently my legacy code has used some VC++6 DLL which has defined CString the 'old' way, & the compiler is complaining when it sees the redefinition of CString in the new afxstr.h.

Can some one help here? Where is the file which contains the old definition of CString? Getting desperate!! TIA!


 
Joined
Dec 1, 2005
Messages
2
Reaction score
0
Solved

Here's replying to my own post (for posterity).
Got that compilation error because some joker who wrote the old code actually defined his own CString class :( and made a mess of everything.

That's why when the compiler tried to compile Microsoft's version, it threw that redefinition error.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top