Click here to Skip to main content
15,906,645 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: newbie question Pin
2-Aug-01 6:10
suss2-Aug-01 6:10 
GeneralRe: newbie question Pin
Remi Morin2-Aug-01 6:14
Remi Morin2-Aug-01 6:14 
GeneralRe: newbie question Pin
Christian Graus2-Aug-01 12:54
protectorChristian Graus2-Aug-01 12:54 
GeneralRe: newbie question Pin
User 81472-Aug-01 13:19
User 81472-Aug-01 13:19 
QuestionDependant ComboBoxen??? Pin
Michael Martin2-Aug-01 4:34
professionalMichael Martin2-Aug-01 4:34 
AnswerRe: Dependant ComboBoxen??? Pin
Tomasz Sowinski2-Aug-01 5:09
Tomasz Sowinski2-Aug-01 5:09 
GeneralRe: Dependant ComboBoxen??? Pin
Michael Martin2-Aug-01 16:06
professionalMichael Martin2-Aug-01 16:06 
AnswerRe: Dependant ComboBoxen??? Pin
Christian Graus2-Aug-01 16:31
protectorChristian Graus2-Aug-01 16:31 
use a multimap ( STL ). A map alllows you to link values like this

m_Parts["fridge'} = "Big fat cardboard box";

A multimap allows for more than one value to be stored for the same index, so you could create a map entry for each storage type for each unit, and then populate the second combobox based on the first.

The alternative, which might be better, is to use a map and store an array of ints, I think you can do this

map<cstring, vector<int=""> > m_Entries; // but make sure there is a space between the two '>'s

and then create another vector or strings, which is the full list of available units. The vector of ints stores the indexes of the units for that part. This means each string is stored only once. If you wanted to sacrifice some elegance for speed, you could also make the first entry an int, the index of the item. That would be faster, but harder to debug/change.



Christian

#include "std_disclaimer.h"

The careful application of terror is also a form of communication.

Eagles may soar, but weasels don't get sucked into jet engines.
GeneralDisplay messages when a fullscreen / DirectX program is running Pin
2-Aug-01 3:57
suss2-Aug-01 3:57 
GeneralVisual C and Crystal Report Pin
2-Aug-01 3:54
suss2-Aug-01 3:54 
GeneralFind library which exports a function Pin
Igor Proskuriakov2-Aug-01 3:18
Igor Proskuriakov2-Aug-01 3:18 
GeneralCOleDateTimeSpan Pin
Gérald Mercet2-Aug-01 2:34
Gérald Mercet2-Aug-01 2:34 
QuestionWhat does NT stand for in Windows NT? Pin
James Parker2-Aug-01 2:05
James Parker2-Aug-01 2:05 
AnswerRe: What does NT stand for in Windows NT? Pin
2-Aug-01 2:09
suss2-Aug-01 2:09 
AnswerRe: What does NT stand for in Windows NT? Pin
Tomasz Sowinski2-Aug-01 2:13
Tomasz Sowinski2-Aug-01 2:13 
AnswerRe: What does NT stand for in Windows NT? Pin
2-Aug-01 2:38
suss2-Aug-01 2:38 
GeneralRe: What does NT stand for in Windows NT? Pin
Pierre MEINDRE2-Aug-01 2:51
Pierre MEINDRE2-Aug-01 2:51 
GeneralRe: What does NT stand for in Windows NT? Pin
Anders Molin2-Aug-01 7:29
professionalAnders Molin2-Aug-01 7:29 
GeneralRe: What does NT stand for in Windows NT? Pin
Steve T2-Aug-01 8:14
Steve T2-Aug-01 8:14 
AnswerRe: What does NT stand for in Windows NT? Pin
2-Aug-01 3:06
suss2-Aug-01 3:06 
AnswerRe: What does NT stand for in Windows NT? Pin
Michael Martin2-Aug-01 3:27
professionalMichael Martin2-Aug-01 3:27 
AnswerRe: What does NT stand for in Windows NT? Pin
2-Aug-01 7:40
suss2-Aug-01 7:40 
GeneralRe: What does NT stand for in Windows NT? Pin
2-Aug-01 8:33
suss2-Aug-01 8:33 
AnswerRe: What does NT stand for in Windows NT? Pin
Chris Meech2-Aug-01 9:28
Chris Meech2-Aug-01 9:28 
GeneralLinker error with bsc Pin
Franz Klein2-Aug-01 0:50
Franz Klein2-Aug-01 0:50 

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.