Click here to Skip to main content
15,914,416 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionRe: WritePrinter API seems Good but Behave Difficult Pin
David Crow27-Oct-05 2:38
David Crow27-Oct-05 2:38 
AnswerRe: WritePrinter API seems Good but Behave Difficult Pin
AsimUmair28-Oct-05 0:04
AsimUmair28-Oct-05 0:04 
GeneralRe: WritePrinter API seems Good but Behave Difficult Pin
David Crow28-Oct-05 2:15
David Crow28-Oct-05 2:15 
Question(const char*)this == this Pin
WernerPos26-Oct-05 23:58
WernerPos26-Oct-05 23:58 
AnswerRe: (const char*)this == this Pin
cmk27-Oct-05 0:44
cmk27-Oct-05 0:44 
GeneralRe: (const char*)this == this Pin
WernerPos27-Oct-05 1:18
WernerPos27-Oct-05 1:18 
GeneralRe: (const char*)this == this Pin
WernerPos27-Oct-05 1:26
WernerPos27-Oct-05 1:26 
GeneralRe: (const char*)this == this Pin
cmk27-Oct-05 2:02
cmk27-Oct-05 2:02 
Generally whenever i see a cast i wonder what is going on.
That is, the code is not as clear as it could be.
I would be more inclined to do something like:

long String::Cmp( const String &S )
{
    if(    m_szValue == S.m_szValue )  return(0);
    if(   !m_szValue )  return(-1);
    if( !S.m_szValue )  return( 1);
    return( strcmp(m_szValue, S.m_szValue) );
}

bool  String::operator == ( const String &S )  const  { return( Cmp(S) == 0 ); }
bool  String::operator <  ( const String &S )  const  { return( Cmp(S) <  0 ); }
...


My Cmp() actuall takes another parameter that defines how the compare is done, i.e. case-insensitive, numeric, ignore (leading, middle, trailing) spaces, ...


...cmk

Save the whales - collect the whole set
GeneralRe: (const char*)this == this Pin
WernerP27-Oct-05 22:11
WernerP27-Oct-05 22:11 
AnswerRe: (const char*)this == this Pin
BadKarma27-Oct-05 1:41
BadKarma27-Oct-05 1:41 
AnswerRe: (const char*)this == this Pin
BadKarma27-Oct-05 2:34
BadKarma27-Oct-05 2:34 
GeneralRe: (const char*)this == this Pin
WernerP27-Oct-05 22:19
WernerP27-Oct-05 22:19 
GeneralRe: (const char*)this == this Pin
WernerP27-Oct-05 2:42
WernerP27-Oct-05 2:42 
QuestionSwitch views inside ChildFrm Pin
LiYS26-Oct-05 22:38
LiYS26-Oct-05 22:38 
QuestionTruncation Pin
Raza568026-Oct-05 22:33
Raza568026-Oct-05 22:33 
AnswerRe: Truncation Pin
Cedric Moonen26-Oct-05 22:41
Cedric Moonen26-Oct-05 22:41 
AnswerRe: Truncation Pin
kakan27-Oct-05 0:51
professionalkakan27-Oct-05 0:51 
QuestionXp Like ScrollBar in VC++ 6.0 Pin
Neagoe Gabriel26-Oct-05 22:19
Neagoe Gabriel26-Oct-05 22:19 
AnswerRe: Xp Like ScrollBar in VC++ 6.0 Pin
Anonymous27-Oct-05 0:01
Anonymous27-Oct-05 0:01 
Questionwincrypt.h? Pin
adonisv26-Oct-05 20:32
adonisv26-Oct-05 20:32 
AnswerRe: wincrypt.h? Pin
__yb26-Oct-05 21:30
__yb26-Oct-05 21:30 
GeneralRe: wincrypt.h? Pin
adonisv27-Oct-05 12:08
adonisv27-Oct-05 12:08 
GeneralRe: wincrypt.h? Pin
TheGreatAndPowerfulOz28-Oct-05 3:21
TheGreatAndPowerfulOz28-Oct-05 3:21 
GeneralRe: wincrypt.h? Pin
adonisv28-Oct-05 13:46
adonisv28-Oct-05 13:46 
GeneralRe: wincrypt.h? Pin
__yb31-Oct-05 21:10
__yb31-Oct-05 21:10 

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.