Click here to Skip to main content
15,920,217 members
Home / Discussions / ATL / WTL / STL
   

ATL / WTL / STL

 
GeneralRe: ATL : Setting Font Pin
Jörgen Sigvardsson7-Feb-05 9:00
Jörgen Sigvardsson7-Feb-05 9:00 
GeneralRe: ATL : Setting Font Pin
ThatsAlok7-Feb-05 15:51
ThatsAlok7-Feb-05 15:51 
GeneralATL COM Pin
surend2k1-Feb-05 19:20
surend2k1-Feb-05 19:20 
GeneralRe: ATL COM Pin
conman1101-Feb-05 20:27
conman1101-Feb-05 20:27 
GeneralRe: ATL COM Pin
vishalmore7-Feb-05 20:30
vishalmore7-Feb-05 20:30 
GeneralRe: ATL COM Pin
vishalmore8-Feb-05 2:58
vishalmore8-Feb-05 2:58 
GeneralSTL Vector sort, memory corruption Pin
Ron Arnan1-Feb-05 10:50
Ron Arnan1-Feb-05 10:50 
GeneralRe: STL Vector sort, memory corruption Pin
Joaquín M López Muñoz2-Feb-05 2:28
Joaquín M López Muñoz2-Feb-05 2:28 
I think the problem lies in that your ItemCompare class does not define a true order between TTT elements. Assuming you wanted to have a lexicographical order (order by d, else by h is d is the same, else by n if h is the same), you can write it like this:
class ItemCompare : std::binary_function<TTT,TTT,bool>
{
public:
bool operator()(const TTT& t1, TTT& t2) const
{
  if (t1.d < t2.d)
    return true;
  if (t1.d > t2.d)
    return false;
  if (t1.h < t2.h)
    return true;
  if (t1.h > t2.h)
    return false;
  if (t1.n < t2.n)
    return true;
  return false;
};
Also, please note your implementation seemed to suggest you were trying to sort things in descending order. This formulation sorts just the opposite, flip the <s and >s is this is not what you want.

Hope this helps,


Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
Want a Boost forum in Code Project? Vote here[^]!
GeneralRe: STL Vector sort, memory corruption Pin
Ron Arnan2-Feb-05 3:55
Ron Arnan2-Feb-05 3:55 
GeneralRe: STL Vector sort, memory corruption Pin
Jörgen Sigvardsson2-Feb-05 10:57
Jörgen Sigvardsson2-Feb-05 10:57 
GeneralRe: STL Vector sort, memory corruption Pin
Joaquín M López Muñoz2-Feb-05 21:59
Joaquín M López Muñoz2-Feb-05 21:59 
GeneralWTL work around WM_NOTIFY Pin
conman1101-Feb-05 7:03
conman1101-Feb-05 7:03 
GeneralEnvDTE::Document.Open returns null Pin
JabraJabra1-Feb-05 6:12
JabraJabra1-Feb-05 6:12 
Generalget project full name Pin
JabraJabra1-Feb-05 2:49
JabraJabra1-Feb-05 2:49 
GeneralTBN_DROPDOWN : Problems with dropdown button in ATL Pin
tnguyen44431-Jan-05 10:16
tnguyen44431-Jan-05 10:16 
GeneralRe: TBN_DROPDOWN : Problems with dropdown button in ATL Pin
Michael Dunn31-Jan-05 11:14
sitebuilderMichael Dunn31-Jan-05 11:14 
GeneralCstring with ATL Pin
JabraJabra31-Jan-05 4:24
JabraJabra31-Jan-05 4:24 
GeneralRe: Cstring with ATL Pin
Ralph Wetzel31-Jan-05 5:49
Ralph Wetzel31-Jan-05 5:49 
GeneralRe: Cstring with ATL Pin
ThatsAlok31-Jan-05 18:09
ThatsAlok31-Jan-05 18:09 
GeneralRe: Cstring with ATL Pin
conman1101-Feb-05 2:12
conman1101-Feb-05 2:12 
GeneralRe: Cstring with ATL Pin
ThatsAlok1-Feb-05 2:54
ThatsAlok1-Feb-05 2:54 
GeneralRe: Cstring with ATL Pin
JabraJabra31-Jan-05 20:36
JabraJabra31-Jan-05 20:36 
Generalfindresource return null Pin
JabraJabra30-Jan-05 0:57
JabraJabra30-Jan-05 0:57 
GeneralParameter problem Pin
Monty229-Jan-05 22:14
Monty229-Jan-05 22:14 
GeneralRe: Parameter problem Pin
Jörgen Sigvardsson29-Jan-05 22:32
Jörgen Sigvardsson29-Jan-05 22:32 

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.