|
-
May 5th, 1999, 11:41 AM
#1
CString Find() error Why ?
When I call the CString member function "Find" the compiler returns
this error..
error C2661: 'Find' : no overloaded function takes 2 parameters
I used the example from (MSDN Library April 1999)
// Second example demonstrating
// CString::Find( TCHAR ch, int nStart )
CString str("The stars are aligned");
int n = str.Find('e', 5);
ASSERT(n == 12);
Is it only available with VC6 ? MS does not mention anything in the
MSDN Library April 1999.
Is VC5 just out of date ?
regards
Hans Wedemeyer

My Web Site
http://www.flash.net/~hansw
-
May 5th, 1999, 12:05 PM
#2
Re: CString Find() error Why ?
I've used this and it's fine, but I'm developing on VC++6. Do a FindInFiles in your DevStudio include directory and look at the members of CString. I bet they didn't exist in your version...
MJA
-
May 5th, 1999, 12:24 PM
#3
Re: CString Find() error Why ?
Hi Hans
Prior to VC6, you'll only have:
int Find( TCHAR ch ) const;
int Find( LPCTSTR lpszSub ) const;
You can derive your own class from CString and add the function you need. I wrote my own function to do this:
int SuperFind(int iFrom, const CString *pszValue, char chChar)
{
CString szTemp;
int iTemp;
szTemp = pszValue->Mid(iFrom);
iTemp = szTemp.Find(chChar);
return iTemp;
}
All the best.
Rail
Recording Engineer/Software Developer
Rail Jon Rogut Software
[email protected]
http://home.earthlink.net/~railro/
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|