Click here to Skip to main content
15,899,754 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: Window caption at center Pin
Arman S.14-Nov-05 1:12
Arman S.14-Nov-05 1:12 
QuestionDestination path ICopyHook Pin
ragavan13-Nov-05 22:17
ragavan13-Nov-05 22:17 
QuestionCButton SetFocus Pin
AORD13-Nov-05 21:00
AORD13-Nov-05 21:00 
AnswerRe: CButton SetFocus Pin
toxcct13-Nov-05 21:38
toxcct13-Nov-05 21:38 
GeneralRe: CButton SetFocus Pin
AORD14-Nov-05 18:23
AORD14-Nov-05 18:23 
GeneralRe: CButton SetFocus Pin
toxcct14-Nov-05 21:19
toxcct14-Nov-05 21:19 
AnswerRe: CButton SetFocus Pin
Rajesh R Subramanian13-Nov-05 23:20
professionalRajesh R Subramanian13-Nov-05 23:20 
GeneralRe: CButton SetFocus Pin
Mircea Puiu14-Nov-05 5:45
Mircea Puiu14-Nov-05 5:45 
AnswerRe: CButton SetFocus Pin
Mircea Puiu14-Nov-05 5:04
Mircea Puiu14-Nov-05 5:04 
Answer... and to see the difference ... Pin
Mircea Puiu14-Nov-05 5:43
Mircea Puiu14-Nov-05 5:43 
GeneralRe: ... and to see the difference ... Pin
Rajesh R Subramanian14-Nov-05 17:18
professionalRajesh R Subramanian14-Nov-05 17:18 
GeneralRe: ... and to see the difference ... Pin
AORD14-Nov-05 18:21
AORD14-Nov-05 18:21 
QuestionWhy CListView do not inherit from CListCtrl Pin
white jungle13-Nov-05 20:49
white jungle13-Nov-05 20:49 
AnswerRe: Why CListView do not inherit from CListCtrl Pin
YaronNir14-Nov-05 1:37
YaronNir14-Nov-05 1:37 
AnswerRe: Why CListView do not inherit from CListCtrl Pin
Sheng Jiang 蒋晟14-Nov-05 19:24
Sheng Jiang 蒋晟14-Nov-05 19:24 
Questiondiff b/w LUID and SID Pin
sunit513-Nov-05 20:25
sunit513-Nov-05 20:25 
AnswerRe: diff b/w LUID and SID Pin
sunit513-Nov-05 21:00
sunit513-Nov-05 21:00 
QuestionIn MFC model less Dialogbox Pin
vikas amin13-Nov-05 19:24
vikas amin13-Nov-05 19:24 
AnswerRe: In MFC model less Dialogbox Pin
Mircea Puiu13-Nov-05 20:13
Mircea Puiu13-Nov-05 20:13 
AnswerRe: In MFC model less Dialogbox Pin
*Dreamz13-Nov-05 20:20
*Dreamz13-Nov-05 20:20 
GeneralRe: In MFC model less Dialogbox Pin
vikas amin13-Nov-05 21:04
vikas amin13-Nov-05 21:04 
Questionuse object itself as key in stl map Pin
yccheok13-Nov-05 19:18
yccheok13-Nov-05 19:18 
AnswerRe: use object itself as key in stl map Pin
Garth J Lancaster13-Nov-05 19:54
professionalGarth J Lancaster13-Nov-05 19:54 
I think your definition of map m is incorrect for a start...

shouldnt it be :-

map < Point, Point > m;

?? - ie you havnt told the compiler what you're storing in map m. One thing you have done (great Smile | :) ) is define the < operator for your class .. from Cprogramming.com :-

"To use the map class, you will need to include and maps are part of the std namespace. Maps require two, and possibly three, types for the template:
std::map < key_type, data_type, [comparison_function] >

Notice that the comparison function is in brackets, indicating that it is optional so long as your key_type has the less-than operator, < , defined -- so you don't need to specify a comparision function for so-called primitive types such as int, char, or even for the string class. Moreover, if you overloaded the < operator for your own class, this won't be necessary.

The reason that the key type needs the less-than operator is that the keys will be stored in sorted order -- this means that if you want to retrieve every key, value pair stored in the map, you can retrieve them in the order of the keys. "

http://www.cprogramming.com/tutorial/stl/stlmap.html[^]

[Edit]
I think you also need to define the < operator with two operands thus :-

bool operator <(const Point &LHS, const Point &RHS){
return LHS.y < RHS.y;
}
[/Edit]


'g'

-- modified at 4:49 Monday 14th November, 2005
AnswerRe: use object itself as key in stl map Pin
*Dreamz13-Nov-05 20:39
*Dreamz13-Nov-05 20:39 
GeneralRe: use object itself as key in stl map Pin
yccheok13-Nov-05 23:05
yccheok13-Nov-05 23:05 

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.