Click here to Skip to main content
16,008,075 members
Home / Discussions / ATL / WTL / STL
   

ATL / WTL / STL

 
AnswerRe: FindFirstFile Pin
sthotakura20-Apr-07 8:50
sthotakura20-Apr-07 8:50 
QuestionATL COM Service Pin
Janma20-Apr-07 1:21
Janma20-Apr-07 1:21 
AnswerRe: ATL COM Service Pin
sthotakura20-Apr-07 8:46
sthotakura20-Apr-07 8:46 
GeneralRe: ATL COM Service Pin
Janma22-Apr-07 19:31
Janma22-Apr-07 19:31 
GeneralRe: ATL COM Service Pin
Janma22-Apr-07 22:03
Janma22-Apr-07 22:03 
GeneralAdding ATL Dialog to WTL application from VS2005 Pin
Ernest Laurentin19-Apr-07 7:33
Ernest Laurentin19-Apr-07 7:33 
Questionusing map Pin
NorGUI18-Apr-07 10:54
NorGUI18-Apr-07 10:54 
AnswerRe: using map Pin
Roger Stoltz18-Apr-07 11:33
Roger Stoltz18-Apr-07 11:33 
NorGUI wrote:
How can I make a good operator < or were can I found some sample to learn about programing operator


Well, there's nothing wrong with the declaration of the operator.
You should consider how negative values of x::a and x::b should be treated.
Your implementation may not give the result you expect if either of the variables were found negative.

Regarding how to make the operator more efficient you can try the following:
bool operator<( const x& w ) const
{
    bool bResult = false;

    if( a == w.a )
    {
        bResult = (b < w.b);
    }
    else
    {
        bResult = (a < w.a);
    }

    return bResult;
}
This is how I think you want your operator to work given the code snippet you posted. It uses the integer values and saves the detour using CString which is quite expensive.


"It's supposed to be hard, otherwise anybody could do it!" - selfquote
"High speed never compensates for wrong direction!" - unknown

Questiontemplate class c2995 operator&amp;lt;&amp;lt; overloading [modified] Pin
ky_rerun17-Apr-07 11:11
ky_rerun17-Apr-07 11:11 
AnswerRe: template class c2995 operator&amp;lt;&amp;lt; overloading Pin
ky_rerun17-Apr-07 19:10
ky_rerun17-Apr-07 19:10 
Questionlinker error in VC6 while linking to VC8 MSXML exports [modified] Pin
chervu17-Apr-07 7:24
chervu17-Apr-07 7:24 
AnswerRe: linker error in VC6 while linking to VC8 MSXML exports Pin
Michael Dunn17-Apr-07 18:00
sitebuilderMichael Dunn17-Apr-07 18:00 
QuestionCombine multiple text files into one ! Pin
snailflying16-Apr-07 14:46
snailflying16-Apr-07 14:46 
QuestionHow to customise IE toolbar Addon [modified] Pin
shivditya16-Apr-07 0:53
shivditya16-Apr-07 0:53 
QuestionIs possible to allocate strictly physical mem. (RAM) instead of page file (virtual mem) Pin
marcelse12-Apr-07 4:49
marcelse12-Apr-07 4:49 
QuestionAdvising to the embedded flash object events Pin
Tomek.Sergey10-Apr-07 13:14
Tomek.Sergey10-Apr-07 13:14 
QuestionTELECOMMUNICATION Pin
ILHEM5-Apr-07 5:42
ILHEM5-Apr-07 5:42 
Questionhow to add check Box in MMC(through ATL) in Result pan Pin
mo_nica8811-Apr-07 23:54
mo_nica8811-Apr-07 23:54 
Questionargv does not equal string (char*) Pin
XTAL25630-Mar-07 19:45
XTAL25630-Mar-07 19:45 
AnswerRe: argv does not equal string (char*) Pin
Michael Dunn31-Mar-07 19:20
sitebuilderMichael Dunn31-Mar-07 19:20 
GeneralRe: argv does not equal string (char*) Pin
XTAL25631-Mar-07 20:09
XTAL25631-Mar-07 20:09 
Questionatl8.0 backward compatibility issue Pin
Shiva Prasad30-Mar-07 1:08
Shiva Prasad30-Mar-07 1:08 
AnswerRe: atl8.0 backward compatibility issue Pin
George L. Jackson10-Apr-07 16:24
George L. Jackson10-Apr-07 16:24 
QuestionConverting to/from UTF8 Pin
Rob Caldecott29-Mar-07 0:08
Rob Caldecott29-Mar-07 0:08 
AnswerRe: Converting to/from UTF8 Pin
Stuart Dootson29-Mar-07 2:45
professionalStuart Dootson29-Mar-07 2:45 

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.