Click here to Skip to main content
15,921,697 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: I'm stuck, not sure which direction to go Pin
jkirkerx3-Dec-11 8:00
professionaljkirkerx3-Dec-11 8:00 
GeneralNextline Pin
jkirkerx3-Dec-11 8:26
professionaljkirkerx3-Dec-11 8:26 
GeneralRe: Nextline Pin
Richard MacCutchan3-Dec-11 9:13
mveRichard MacCutchan3-Dec-11 9:13 
Questioni can't load dll builded in debug unicode,what's difference between 'debug' and 'debug unicode'? Pin
Member 77984732-Dec-11 5:06
Member 77984732-Dec-11 5:06 
AnswerRe: i can't load dll builded in debug unicode,what's difference between 'debug' and 'debug unicode'? Pin
JackDingler2-Dec-11 5:19
JackDingler2-Dec-11 5:19 
AnswerRe: i can't load dll builded in debug unicode,what's difference between 'debug' and 'debug unicode'? Pin
Erudite_Eric2-Dec-11 5:44
Erudite_Eric2-Dec-11 5:44 
AnswerRe: i can't load dll builded in debug unicode,what's difference between 'debug' and 'debug unicode'? Pin
Richard MacCutchan2-Dec-11 6:20
mveRichard MacCutchan2-Dec-11 6:20 
Questionclass object as parameter of Template Function Pin
002comp2-Dec-11 0:29
002comp2-Dec-11 0:29 
QuestionRe: class object as parameter of Template Function Pin
CPallini2-Dec-11 0:43
mveCPallini2-Dec-11 0:43 
AnswerRe: class object as parameter of Template Function Pin
002comp2-Dec-11 0:50
002comp2-Dec-11 0:50 
QuestionRe: class object as parameter of Template Function Pin
CPallini2-Dec-11 0:53
mveCPallini2-Dec-11 0:53 
AnswerRe: class object as parameter of Template Function Pin
Chris Losinger2-Dec-11 1:29
professionalChris Losinger2-Dec-11 1:29 
GeneralRe: class object as parameter of Template Function Pin
CPallini2-Dec-11 1:32
mveCPallini2-Dec-11 1:32 
AnswerRe: class object as parameter of Template Function Pin
002comp2-Dec-11 1:30
002comp2-Dec-11 1:30 
GeneralRe: class object as parameter of Template Function Pin
CPallini2-Dec-11 1:44
mveCPallini2-Dec-11 1:44 
GeneralRe: class object as parameter of Template Function Pin
Addy Tas4-Dec-11 10:45
Addy Tas4-Dec-11 10:45 
Questionbad ON_EN_CHANGE management Pin
waltermei1-Dec-11 22:49
waltermei1-Dec-11 22:49 
AnswerRe: bad ON_EN_CHANGE management Pin
Code-o-mat2-Dec-11 0:38
Code-o-mat2-Dec-11 0:38 
GeneralRe: bad ON_EN_CHANGE management Pin
waltermei2-Dec-11 1:41
waltermei2-Dec-11 1:41 
GeneralRe: bad ON_EN_CHANGE management Pin
Code-o-mat2-Dec-11 3:12
Code-o-mat2-Dec-11 3:12 
QuestionCall Win32 dll from COM dll Pin
MrKBA1-Dec-11 22:39
MrKBA1-Dec-11 22:39 
AnswerRe: Call Win32 dll from COM dll Pin
Richard MacCutchan1-Dec-11 23:00
mveRichard MacCutchan1-Dec-11 23:00 
AnswerRe: Call Win32 dll from COM dll Pin
Addy Tas4-Dec-11 10:51
Addy Tas4-Dec-11 10:51 
Questionhow can i find CString value in std::map iterator? Pin
Le@rner1-Dec-11 19:15
Le@rner1-Dec-11 19:15 
AnswerRe: how can i find CString value in std::map iterator? Pin
«_Superman_»1-Dec-11 20:49
professional«_Superman_»1-Dec-11 20:49 
The iterator must be defines as - std::map<CString, std::map<DWORD, CString> >::iterator m_mpIter;
You can then access the key using m_mpIter->first.
To access the value you do m_mpIter->Second.

Since the value is another map, you will need to iterate through that map too.

Here is a nested loop that can iterate through the entire collection -
for (auto i = map1.begin(); i != map1.end(); ++i)
{
  i->first;  // CString key of map
  for (auto j = i->second.begin(); j != i->second.end(); ++j)
  {
    j->first;  // DWORD key of internal map
    j->second; // CString value of internal map
  }
}
I have assumed the map to be named as map1.
Also, since I'm using the auto keyword, this will compile only in VS2010 or later versions.
If you're using older versions of Visual Studio you will need to replace the auto keyword with the following -
std::map<CString, std::map<DWORD, CString> >::iterator i;
std::map<DWORD, CString>::iterator j;

«_Superman 
I love work. It gives me something to do between weekends.


Microsoft MVP (Visual C++)

Polymorphism in C

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.