Click here to Skip to main content
15,922,315 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: Click-through color-key transparency Pin
Malli_S29-Dec-08 23:52
Malli_S29-Dec-08 23:52 
GeneralRe: Click-through color-key transparency Pin
Ohad Maishar30-Dec-08 0:11
Ohad Maishar30-Dec-08 0:11 
GeneralRe: Click-through color-key transparency Pin
Malli_S30-Dec-08 0:20
Malli_S30-Dec-08 0:20 
GeneralRe: Click-through color-key transparency Pin
Ohad Maishar30-Dec-08 0:40
Ohad Maishar30-Dec-08 0:40 
QuestionHtmlHelp Problem Pin
Ali Tavakol29-Dec-08 21:34
Ali Tavakol29-Dec-08 21:34 
AnswerRe: HtmlHelp Problem Pin
sashoalm29-Dec-08 22:30
sashoalm29-Dec-08 22:30 
GeneralRe: HtmlHelp Problem Pin
Ali Tavakol30-Dec-08 0:38
Ali Tavakol30-Dec-08 0:38 
GeneralRe: HtmlHelp Problem Pin
sashoalm3-Jan-09 6:17
sashoalm3-Jan-09 6:17 
GeneralRe: HtmlHelp Problem Pin
Theo Buys7-Jan-09 2:46
Theo Buys7-Jan-09 2:46 
GeneralRe: HtmlHelp Problem Pin
Theo Buys7-Jan-09 3:28
Theo Buys7-Jan-09 3:28 
GeneralRe: HtmlHelp Problem Pin
sashoalm8-Jan-09 1:32
sashoalm8-Jan-09 1:32 
GeneralRe: HtmlHelp Problem Pin
Theo Buys12-Jan-09 0:14
Theo Buys12-Jan-09 0:14 
QuestionHow can handle buttons of Preview window? Pin
Le@rner29-Dec-08 21:18
Le@rner29-Dec-08 21:18 
AnswerRe: How can handle buttons of Preview window? Pin
pallaka29-Dec-08 22:18
pallaka29-Dec-08 22:18 
GeneralRe: How can handle buttons of Preview window? Pin
Le@rner29-Dec-08 22:40
Le@rner29-Dec-08 22:40 
GeneralRe: How can handle buttons of Preview window? Pin
pallaka30-Dec-08 1:16
pallaka30-Dec-08 1:16 
GeneralRe: How can handle buttons of Preview window? Pin
Le@rner30-Dec-08 1:26
Le@rner30-Dec-08 1:26 
QuestionRemovable hard disk Pin
MsmVc29-Dec-08 20:55
MsmVc29-Dec-08 20:55 
QuestionHow to create child window in SDI application? Pin
Abhijit D. Babar29-Dec-08 20:24
Abhijit D. Babar29-Dec-08 20:24 
Questionhow to convert binary values into decimal by getting these values from dialog box? Pin
puppya29-Dec-08 20:14
puppya29-Dec-08 20:14 
AnswerRe: how to convert binary values into decimal by getting these values from dialog box? Pin
enhzflep29-Dec-08 20:48
enhzflep29-Dec-08 20:48 
GeneralRe: how to convert binary values into decimal by getting these values from dialog box? Pin
CPallini29-Dec-08 21:04
mveCPallini29-Dec-08 21:04 
Questionstd::map or stdex:hash_map Pin
Swinefeaster29-Dec-08 18:13
Swinefeaster29-Dec-08 18:13 
hi there,

i'm trying to set up a hash map such as:

class ObserversByMessageMap :
  public stdext::hash_map<messagekey,>
{};


and i've got MessageKey defined with these operators:

bool operator==(const MessageKey& other)const;
bool operator!=(const MessageKey& other)const;
bool operator<(const MessageKey& other)const;
bool operator>(const MessageKey& other)const;

// Used for hashing.
operator size_t(void)const;


something doesn't work quite right however. i'm trying to do something like:

MessageObserverSet& observers = (*m_observersByMessageMap)[key];
observers.insert(observer);


but it appears that the map (either hash or map) seems to collide with a *different* key than what i expect, and therefore adds the observer to the wrong pre-existing key.

i figured the operator==() is supposed to prevent that from happening, but it aint being called. instead the size_t hash is called and also the < operator, which i've defined as:

bool 
MessageKey::operator<(const MessageKey& other)const
{
  bool lessThan = false;

  if(m_messageId <= other.m_messageId)
  {
    if(m_objectId < other.m_objectId)
    {
      lessThan = true;
    }
  }

  return lessThan;
}


since m_objectId is a nested object.

any ideas? in mfc this kind of stuff worked no problem...

Frown | :(
QuestionLinking to another project [SOLVED] Pin
Christian Flutcher29-Dec-08 17:17
Christian Flutcher29-Dec-08 17:17 
AnswerRe: Linking to another project [SOLVED] Pin
Cedric Moonen29-Dec-08 21:40
Cedric Moonen29-Dec-08 21:40 

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.