If you could do the same features in basic::string then performance will be much.. much betterReply
I don't like the idea of using #define to fool the compiler -- it seems to me like a hack that could easily bite you in the a$$ later on down the road. i'm using VS8. so to fix CStringEx, i replaced all 22 instances of "m_pchData" with (LPTSTR)GetString(). there were three exceptions in the FindReplaceNoCase() function where i needed to replace something like sLowerThis.m_pchData with (LPTSTR)sLowerThis.GetString(). (same for sLowerSub) after i did that, my CStringEx class was happy once again ;-)
ReplyIt's not working for version 7.1.3088. They probably fixed the "fool the compiler" thing. ".. error C2248: cannot access private member declared in class .."
i agree with caswi. I don't like the idea of using #define to fool the compiler -- it seems to me like a hack that could easily bite you in the a$$ later on down the road. i'm using VS8. so to fix CStringEx, i replaced all 22 instances of "m_pchData" with (LPTSTR)GetString(). there are a couple of exceptions in the FindReplaceNoCase() function where i needed to replace sLowerThis.m_pchData with (LPTSTR)sLowerThis.GetString(). after i did that, my CStringEx class was happy once again ;-)Reply
try to replace "m_pchData" with "GetString()"
ReplyAdd this code to the beginning of the cpp file. This will let the VS.net work and still work for earlier versions also. #include "afxver_.h" #if _MFC_VER >= 0x0700 #define private public #define protected public #define m_pchData m_pszData #endifReply
Yes they changed the member name and the way CString works. Here's the 'hack' I found on another web page. Put these three lines at the beginning of the cpp file(before stdafx.h). It fools the complier. #define private public #define protected public #define m_pchData m_pszData Good LuckReply
Originally posted by: Mykel
Hi,
the class compiles fine under Visual Studio 6. But now I'm using VS7 and I get the followring error:
"m_pchData undefined"
Don't know how to fix this. Does anybody have a clue?
Did they change the CString class?
Many thx in advance...
Mykel
Yes they changed the member name and the way CString works. Here's the 'hack' I found on another web page. Put these three lines at the beginning of the cpp file(before stdafx.h). It fools the complier. #define private public #define protected public #define m_pchData m_pszData Good LuckReply
Yes they changed the member name and the way CString works. Here's the 'hack' I found on another web page. Put these three lines at the beginning of the cpp file. It fools the complier. #define private public #define protected public #define m_pchData m_pszData Good LuckReply
Recently I got a few mails from coders that also have the problem with "m_pchData undefined" under VS7. I still don't have a solution or a workaround for the problem. I believe that some parts of the CStringEx class must be recoded cause the MFC base classes changed... but I really have no time at the moment. If anybody finds a solution please post it here!!! :-) Regards, mYkel
ReplyOriginally posted by: Gayatri
Thank You a million times...this article is a life saver!:)
Best Regards
Gayatri.
Originally posted by: Dieter Hammer
this worked fine for me. Now I want to recompile the application with VC7. But m_pchDATA ist undefined.
ReplyOriginally posted by: Mouse
ReverseFind doesnt work if the string your are trying to find is at the front of the string.
Originally posted by: d.e. bugger
The code plugged right into my large project and seems to work well so far. I'm using it primarily for the reverse find functionality.
In addition, I'd like to see something that provides "entire word" search (in reverse) for the standard CFindReplace dialog. Good job!
Reply