Click here to Skip to main content
15,914,820 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: MFC Dialog application Pin
CPallini6-Jan-09 4:07
mveCPallini6-Jan-09 4:07 
GeneralRe: MFC Dialog application Pin
bhanu_85096-Jan-09 23:14
bhanu_85096-Jan-09 23:14 
GeneralRe: MFC Dialog application Pin
CPallini6-Jan-09 23:51
mveCPallini6-Jan-09 23:51 
AnswerRe: MFC Dialog application Pin
Rajesh R Subramanian6-Jan-09 4:40
professionalRajesh R Subramanian6-Jan-09 4:40 
JokeRe: MFC Dialog application Pin
CPallini6-Jan-09 5:19
mveCPallini6-Jan-09 5:19 
GeneralRe: MFC Dialog application Pin
Rajesh R Subramanian7-Jan-09 4:16
professionalRajesh R Subramanian7-Jan-09 4:16 
GeneralRe: MFC Dialog application Pin
CPallini7-Jan-09 6:05
mveCPallini7-Jan-09 6:05 
AnswerRe: MFC Dialog application Pin
led mike6-Jan-09 4:56
led mike6-Jan-09 4:56 
GeneralRe: MFC Dialog application Pin
Nemanja Trifunovic6-Jan-09 6:15
Nemanja Trifunovic6-Jan-09 6:15 
GeneralRe: MFC Dialog application Pin
CPallini6-Jan-09 6:23
mveCPallini6-Jan-09 6:23 
Questionhow to detect the number key in MFC? Pin
Kingis6-Jan-09 2:46
Kingis6-Jan-09 2:46 
AnswerRe: how to detect the number key in MFC? Pin
Iain Clarke, Warrior Programmer6-Jan-09 2:56
Iain Clarke, Warrior Programmer6-Jan-09 2:56 
AnswerRe: how to detect the number key in MFC? Pin
Sarath C6-Jan-09 2:59
Sarath C6-Jan-09 2:59 
AnswerRe: how to detect the number key in MFC? Pin
John R. Shaw7-Jan-09 7:07
John R. Shaw7-Jan-09 7:07 
GeneralRe: how to detect the number key in MFC? Pin
Sarath C7-Jan-09 16:49
Sarath C7-Jan-09 16:49 
QuestionAny design pattern to manage HTTP request? Pin
kuibing6-Jan-09 2:21
kuibing6-Jan-09 2:21 
AnswerRe: Any design pattern to manage HTTP request? Pin
Randor 6-Jan-09 18:57
professional Randor 6-Jan-09 18:57 
QuestionProblem using struct as std::map value type Pin
Manfr3d6-Jan-09 1:57
Manfr3d6-Jan-09 1:57 
Hello guys,

I wanna make a map that contains an integer key and a struct as value type.

struct SRect
{
int iX, iY, iW, iH;
};
map<unsigned int=""> RectMap;

This piece of code compiles fine. However, if I want to insert a pair into the map a runtime error occurs.

void MakeParamRect(int iID, int iX, int iY, int iW, int iH)
{
RectMap[iID]->iX = iX;
RectMap[iID]->iY = iY;
RectMap[iID]->iW = iW;
RectMap[iID]->iH = iH;
}

I've also tried it using the insert() function.

RectMap.insert(make_pair(iID, {iX, iY, iW, iH}));

In this case the struct notation with the curly brackets seems to produce the error (compiler says that a semicolon is missing before the first {).

How can I make this code work, or is a struct not a valid value type for a map (it is valid in my opinion)?

Thanks for your help.
AnswerRe: Problem using struct as std::map value type Pin
Franck Paquier6-Jan-09 2:49
Franck Paquier6-Jan-09 2:49 
AnswerRe: Problem using struct as std::map value type Pin
Stuart Dootson6-Jan-09 2:57
professionalStuart Dootson6-Jan-09 2:57 
AnswerRe: Problem using struct as std::map value type Pin
Malli_S6-Jan-09 3:00
Malli_S6-Jan-09 3:00 
AnswerRe: Problem using struct as std::map value type Pin
Sarath C6-Jan-09 3:07
Sarath C6-Jan-09 3:07 
GeneralRe: Problem using struct as std::map value type Pin
Manfr3d6-Jan-09 6:37
Manfr3d6-Jan-09 6:37 
GeneralRe: Problem using struct as std::map value type Pin
Sarath C6-Jan-09 6:47
Sarath C6-Jan-09 6:47 
AnswerRe: Problem using struct as std::map value type Pin
John R. Shaw7-Jan-09 7:57
John R. Shaw7-Jan-09 7:57 

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.