|
Nish [BusterBoy] wrote:
just saw a CHString class. It's a non-MFC class, too!
When did the PSDK start giving us utility classes? I am very much puzzled. It's not part of MFC too
It is not really a "General" utility class, it is part of the WMI (MS's version of WBEM) SDK. It is basically just a copy of CString .
Peace!
-=- James.
(Try Check Favorites Sometime!)
|
|
|
|
|
James R. Twine wrote:
It is not really a "General" utility class, it is part of the WMI (MS's version of WBEM) SDK. It is basically just a copy of CString
Thanks James.
Nish
The posting stats are now in PDF:-
http://www.busterboy.org/codeproject/
Feel free to make your comments.
Updated - May 04th, Saturday
|
|
|
|
|
Was it dumped? Now seems as if we hava a CStringT which is a templated class!
Nish
The posting stats are now in PDF:-
http://www.busterboy.org/codeproject/
Feel free to make your comments.
Updated - May 04th, Saturday
|
|
|
|
|
Yes, it is now gone. However, you will rarely even notice as you can still define things as CString and the CStringT will automatically be used. You can see this if you construct a CString and step into its construction. You'll find that you're in the CStringT constructor
Cheers,
Tom Archer
Author, Inside C#
Author, Visual C++.NET Bible
A total abstainer is one who abstains from everything but abstention, and especially from inactivity in the af
|
|
|
|
|
Thanks Tom.
So I guess old code won't break as I thought it will.
Nish
The posting stats are now in PDF:-
http://www.busterboy.org/codeproject/
Feel free to make your comments.
Updated - May 04th, Saturday
|
|
|
|
|
There's a couple of situations where you will have to change your code. However, you'll get compile-time errors and they're easy enough to figure out.
Cheers,
Tom Archer
Author - Inside C#, Visual C++.NET Bible
A total abstainer is one who abstains from everything but abstention, and especially from inactivity in the af
|
|
|
|
|
Tom Archer wrote:
There's a couple of situations where you will have to change your code. However, you'll get compile-time errors and they're easy enough to figure out.
Yeah, I expect it to be that way. I mean they wouldn't be able to maintain a 100% compatibility thing if they wanted to also really improve things.
Nish
The posting stats are now in PDF:-
http://www.busterboy.org/codeproject/
Feel free to make your comments.
Updated - May 04th, Saturday
|
|
|
|
|
|
theres VC++ 7.0 now?
that tells you how behind i am
~SilverShalkin
|
|
|
|
|
You've not heard of Visual Studio .NET, or you just don't know what it is ?
Christian
The tragedy of cyberspace - that so much can travel so far, and yet mean so little.
And you don't spend much time with the opposite sex working day and night, unless the pizza delivery person happens to be young, cute, single and female. I can assure you, I've consumed more than a programmer's allotment of pizza, and these conditions have never aligned. - Christopher Duncan - 18/04/2002
|
|
|
|
|
Christian Graus wrote:
You've not heard of Visual Studio .NET, or you just don't know what it is ?
It's amazing that despite all the marketing MS did, that he never heard of .NET
Nish
The posting stats are now in PDF:-
http://www.busterboy.org/codeproject/
Feel free to make your comments.
Updated - May 04th, Saturday
|
|
|
|
|
The good thing about having the CStringT template class, is that you can now use both the char and wchar_t type CStrings in your program. Previously the compiler would choose one or the other versions based on your __UNICODE definition.
Build a man a fire, and he will be warm for a day Light a man on fire, and he will be warm for the rest of his life!
|
|
|
|
|
YES!!!
I ended up having to create my own CString class a couple of years ago since I needed both at once.
Tim Smith
I know what you're thinking punk, you're thinking did he spell check this document? Well, to tell you the truth I kinda forgot myself in all this excitement. But being this here's CodeProject, the most powerful forums in the world and would blow your head clean off, you've got to ask yourself one question, Do I feel lucky? Well do ya punk?
|
|
|
|
|
I was looking through the help for " _lfind " function but having trouble using it. Could anyone help please?
This is my situation
I have three CString Variables:
m_strEnterData, m_strFindData, m_DisplayResult
m_strEnterData has the input string.
m_strFindData has the string I am searching in m_strEnterData.
m_DisplayResult is where I want to display the result
I saw the syntax for _lfind in the help but having trouble fitting it for my scenario. Can someone help ?
Thank you so much. This board has been a lifesaver.
M
|
|
|
|
|
i´m not a MFC guy so i might be wrong but try this...
int index = m_strEnterData.Find( m_strFindData ) ;
if( index != -1 ) // has it found it?
{
m_DisplayData = m_strEnterData.Mid( index, m_strFindData.Length() ) ;
}
Gabriel
Old C programmers never die. They just cast into void
|
|
|
|
|
Do you mean you want to search m_strEnterData for m_strFindData and then put the index of the location into m_DisplayResult? If so, why should m_DisplayResult be a CString? If not, what's supposed to be in m_DisplayResult ?
Nish
The posting stats are now in PDF:-
http://www.busterboy.org/codeproject/
Feel free to make your comments.
Updated - May 04th, Saturday
|
|
|
|
|
Yes you are right. Search for m_strFindData in m_strEnterData. If it is not found, move a message to m_strDisplayResult saying "not found".
|
|
|
|
|
Anyone managed to use custom draw on toolbars? I´m getting the notification messages but some options doesn´t seem to work, and the others are really poorly documented. I want to use "clrBtnHighlight", but the docs say that the item should have the tbstyle_marked to function properly, and searching for this style on the web i´ve only found "Version 4.71. The button is marked. The interpretation of a marked item is dependent upon the application".
Any help would be appreciated
Gabriel
Old C programmers never die. They just cast into void
|
|
|
|
|
I am trying to use string reverse (_strrev) function to reverse a string. Looks like string reverse does not like the data that it is reversing to be of the type CString.
Is there another function for this or should I convert it to a character type?
Thank you
M
|
|
|
|
|
CString str = "text";
char* szReversed;
szReversed = _strrev(str.GetBuffer(0));
Cheers,
Tom Archer
Author, Inside C#
Author, Visual C++.NET Bible
A total abstainer is one who abstains from everything but abstention, and especially from inactivity in the af
|
|
|
|
|
|
Tom Archer wrote:
szReversed = _strrev(str.GetBuffer(0));
The OP may have to call ReleaseBuffer(...) after reversing the string if the CString itself continues to be used... Of course, at this point szReversed should be treated as a const pointer...
Peace!
-=- James.
(Try Check Favorites Sometime!)
|
|
|
|
|
Good point, James. I omitted mentioning the CString::ReleaseBuffer in this example because I assumed that the CString would not be used any further. I should probably include a sentence about using the CString::ReleaseBuffer when prescribing the CString::GetBuffer function.
Cheers,
Tom Archer
Author - Inside C#, Visual C++.NET Bible
A total abstainer is one who abstains from everything but abstention, and especially from inactivity in the af
|
|
|
|
|
You should ReleaseBuffer call after you´re ready with the szReversed!!!
While you´re poiting to the CString buffer it should be locked.;)
|
|
|
|
|
KarstenK wrote:
You should ReleaseBuffer call after you´re ready with the szReversed!!!
While you´re poiting to the CString buffer it should be locked.
While you are manipulating the buffer, the buffer should be locked. And, from the OP's original question: "I am trying to use string reverse (_strrev) function to reverse a string", so (s)he is done with manipulating szReversed after the contents have been reversed.
The problem is that if the OP tried to append to the CString right after the call to ::strrev(...) , the reversed CString would likely be lost. But not if CString::ReleaseBuffer(...) had been called.
" "
Peace!
-=- James.
"Fat people are hard to kidnap."
(Try Check Favorites Sometime!)
|
|
|
|