A
adsci
Hello!
Im posting this to c.l.c++ AND win32 because i dont know if this is a MS
Compiler Issue or not.
here we go:
<code>
class MyCString
{
MyCString ();
~MyCString ();
MyCString (const CString ¶m);
MyCString (LPCTSTR param);
MyCString &operator=(const CString ¶m);
MyCString &operator=(LPCTSTR param);
operator LPCTSTR () const;
.
.
.
};
bool operator==(const CString ¶m1, const CString ¶m2);
bool operator==(const CString ¶m1, LPCTSTR param2);
....
TCHAR filefolder[MAXFOLDERLEN];
MyCString foldername;
if(filefolder == foldername) // error C2666: '==' : 3 overloads have
similar conversions
..
..
..
</code>
LPCTSTR = const short * with current switches.
i do not how to tell the compiler that *no* conversion should be used
with the global == operators. if i delete the custom conversion operator
everything runs fine.
when i kill both == operators it compiles nice, but i guess on compare
it will compare the pointers and not the strings, right?
any suggestions?
THANK YOU!
Marcel
Im posting this to c.l.c++ AND win32 because i dont know if this is a MS
Compiler Issue or not.
here we go:
<code>
class MyCString
{
MyCString ();
~MyCString ();
MyCString (const CString ¶m);
MyCString (LPCTSTR param);
MyCString &operator=(const CString ¶m);
MyCString &operator=(LPCTSTR param);
operator LPCTSTR () const;
.
.
.
};
bool operator==(const CString ¶m1, const CString ¶m2);
bool operator==(const CString ¶m1, LPCTSTR param2);
....
TCHAR filefolder[MAXFOLDERLEN];
MyCString foldername;
if(filefolder == foldername) // error C2666: '==' : 3 overloads have
similar conversions
..
..
..
</code>
LPCTSTR = const short * with current switches.
i do not how to tell the compiler that *no* conversion should be used
with the global == operators. if i delete the custom conversion operator
everything runs fine.
when i kill both == operators it compiles nice, but i guess on compare
it will compare the pointers and not the strings, right?
any suggestions?
THANK YOU!
Marcel