Compile Issues from VC++ 6.0 to .NET
Here's my current compile error...
In our code we overwrite the CString class with our own string class. Along with other things, we have added several operators. Our header code which worked fine before (VC++ 6.0) now comes up as a compile error (VC++ 7). See red text below.
#include afx.h
#include istream
class string : public CString
{
public:
//----------------------
// Used in comparisons.
// If the value is zero, comparisons are case insensitive.
// If the value is one, comparisons are case sensitive.
//----------------------
static int caseSensitivity;
// enum used by strip function
enum StripType { Leading, Trailing, Both };
//----------------------
// + operator
//----------------------
friend string operator +(const string& string1, const string& string2);
friend string operator +(const string& str, TCHAR ch);
friend string operator +(TCHAR ch, const string& str);
friend string operator +(const string& str, LPCTSTR lpsz);
friend string operator +(LPCTSTR lpsz, const string& string);
...
//----------------------
// >> operator
//----------------------
friend istream& operator >> (istream& is, string& str);
friend ostream& operator << (ostream& os, const string& str);
Here's the errors generated by this code.
c:\home\...\utils\portable\cstring.h(155): error C2143: syntax error : missing ';' before '&'
c:\home\...\utils\portable\cstring.h(155): error C2433: 'istream' : 'friend' not permitted on data declarations
c:\home\...\utils\portable\cstring.h(155): error C2501: 'istream' : missing storage-class or type specifiers
c:\home\...\utils\portable\cstring.h(155): error C2061: syntax error : identifier 'istream'
c:\home\...\utils\portable\cstring.h(155): error C2501: 'string:: operator`>>'' : missing storage-class or type specifiers
It really seems like it doesn't recognize the istream class, or something to do with the istream address... Can anyone offer suggestions?
Thanks!

