Click here to Skip to main content
15,891,184 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: How much Memory my App uses? Pin
Software20073-Jun-10 9:56
Software20073-Jun-10 9:56 
GeneralRe: How much Memory my App uses? Pin
Nuri Ismail4-Jun-10 5:49
Nuri Ismail4-Jun-10 5:49 
Question(Probably a non-question) CString GetLength vs. IsEmpty ? Pin
Maximilien2-Jun-10 4:13
Maximilien2-Jun-10 4:13 
AnswerRe: (Probably a non-question) CString GetLength vs. IsEmpty ? Pin
Aescleal2-Jun-10 4:25
Aescleal2-Jun-10 4:25 
AnswerRe: (Probably a non-question) CString GetLength vs. IsEmpty ? Pin
David Crow2-Jun-10 5:52
David Crow2-Jun-10 5:52 
GeneralRe: (Probably a non-question) CString GetLength vs. IsEmpty ? Pin
Emilio Garavaglia2-Jun-10 7:15
Emilio Garavaglia2-Jun-10 7:15 
GeneralRe: (Probably a non-question) CString GetLength vs. IsEmpty ? Pin
David Crow2-Jun-10 8:08
David Crow2-Jun-10 8:08 
GeneralRe: (Probably a non-question) CString GetLength vs. IsEmpty ? Pin
Emilio Garavaglia2-Jun-10 20:53
Emilio Garavaglia2-Jun-10 20:53 
It seems you are misunderstanding some of my points. Let me try to clarify.

DavidCrow wrote:
True, but saying if a text is empty and if the text's length is 0 are identical.


Yes ... but what about the opostite? (saying it is not empty doesn't say the length. Moral: the concepts are not "identical" - in math sense- since the symmetrical property is not valid. But is is true that the length concept includes the empty concept in it. It not the same: it is more general, and requires more informations, in general terms)

DavidCrow wrote:
It hasn't since day one and likely won't for the foreseeable future.

As far everybody can know(in technical sense) this fact gives to your assumption a very high probability to remain always true.
But this fact does not depend on you, so it is not something you should rely on. The CString documentation doesn't say that IsEmpty() will always be implemented the same as GetLength(). You are -in fact- reverse-engineering the current implementation. Good to learn how it works, but no more than this. You have to discover why the designers did it that way. But code tells you only how it is done.

DavidCrow wrote:
...wrong since GetLength() is not a boolean function

C++ operators are overridable, and C++ itself defines operator! for all integral types, with a precise definition.
I'm not "treating it as boolean". I'm evaluating an integer expression.
C++ is not C. Certain "good C practice" are not valid for C++, especially if you're thinking to generic code (where !!a is often used as a "pseudo operator" to convert whatever A supporting ! into a boolean)

In any case, the most of all these things are much more matter of taste, than substance. I agree.

2 bugs found.
> recompile ...
65534 bugs found.
D'Oh! | :doh:


QuestionInterview question Pin
AkashAg2-Jun-10 2:28
AkashAg2-Jun-10 2:28 
AnswerRe: Interview question Pin
Aescleal2-Jun-10 2:38
Aescleal2-Jun-10 2:38 
GeneralRe: Interview question Pin
AkashAg2-Jun-10 2:45
AkashAg2-Jun-10 2:45 
QuestionDllRegister Server Error 0x8007007e Pin
Schehaider_Aymen2-Jun-10 0:58
Schehaider_Aymen2-Jun-10 0:58 
AnswerRe: DllRegister Server Error 0x8007007e Pin
KarstenK2-Jun-10 2:40
mveKarstenK2-Jun-10 2:40 
GeneralRe: DllRegister Server Error 0x8007007e Pin
Schehaider_Aymen2-Jun-10 3:05
Schehaider_Aymen2-Jun-10 3:05 
GeneralRe: DllRegister Server Error 0x8007007e Pin
Schehaider_Aymen2-Jun-10 3:29
Schehaider_Aymen2-Jun-10 3:29 
GeneralRe: DllRegister Server Error 0x8007007e Pin
KarstenK2-Jun-10 3:34
mveKarstenK2-Jun-10 3:34 
GeneralRe: DllRegister Server Error 0x8007007e Pin
Schehaider_Aymen2-Jun-10 4:24
Schehaider_Aymen2-Jun-10 4:24 
GeneralRe: DllRegister Server Error 0x8007007e Pin
KarstenK2-Jun-10 4:33
mveKarstenK2-Jun-10 4:33 
GeneralRe: DllRegister Server Error 0x8007007e Pin
Code-o-mat2-Jun-10 4:30
Code-o-mat2-Jun-10 4:30 
GeneralRe: DllRegister Server Error 0x8007007e Pin
Schehaider_Aymen2-Jun-10 5:01
Schehaider_Aymen2-Jun-10 5:01 
AnswerRe: DllRegister Server Error 0x8007007e Pin
Schehaider_Aymen2-Jun-10 5:31
Schehaider_Aymen2-Jun-10 5:31 
Questionwin32 service crashing in vista Pin
Subrat Patnaik2-Jun-10 0:01
Subrat Patnaik2-Jun-10 0:01 
AnswerRe: win32 service crashing in vista Pin
Aescleal2-Jun-10 0:41
Aescleal2-Jun-10 0:41 
QuestionVS2010 - debug version compiles, release version does not PinPopular
Ed SHaw1-Jun-10 22:38
Ed SHaw1-Jun-10 22:38 
AnswerRe: VS2010 - debug version compiles, release version does not Pin
KarstenK2-Jun-10 0:23
mveKarstenK2-Jun-10 0:23 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.