Click here to Skip to main content
15,915,855 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionIdentifying Memory leak location Pin
ganesh.dp26-Aug-10 0:01
ganesh.dp26-Aug-10 0:01 
AnswerRe: Identifying Memory leak location Pin
Aescleal26-Aug-10 0:16
Aescleal26-Aug-10 0:16 
GeneralRe: Identifying Memory leak location Pin
ganesh.dp26-Aug-10 0:27
ganesh.dp26-Aug-10 0:27 
AnswerRe: Identifying Memory leak location Pin
Niklas L26-Aug-10 0:41
Niklas L26-Aug-10 0:41 
AnswerRe: Identifying Memory leak location PinPopular
Frank Seidler26-Aug-10 1:08
Frank Seidler26-Aug-10 1:08 
AnswerRe: Identifying Memory leak location Pin
Chris Losinger26-Aug-10 1:10
professionalChris Losinger26-Aug-10 1:10 
AnswerRe: Identifying Memory leak location Pin
chen shi26-Aug-10 5:10
chen shi26-Aug-10 5:10 
QuestionError 2758 Pin
T.RATHA KRISHNAN25-Aug-10 23:35
T.RATHA KRISHNAN25-Aug-10 23:35 
Hi!
I've declared a global structure. Inside the constructor, I've initialized the structure elements. But I got the following error:

Error 2 error C2758: 'CInitMenu::initMnuContext' : must be initialized in constructor base/member initializer list e:\CricketProject\Cricket\InitMenu.cpp 51

Here is my structure:

struct SAppContext
{
 irr::IrrlichtDevice *device;
 irr::s32 counter;
 irr::gui::IGUIButton* m_pPlayButton,*m_pOptionsButton,*m_pCreditsButton,*m_pExitButton;
};


I've created a reference to this structure in side my class:

private:
    SAppContext &initMnuContext;
    irr::IrrlichtDevice *dev;
    irr::gui::IGUIButton *m_pPlayButton,*m_pOptionsButton,*m_pCreditsButton,*m_pExitButton;


I'm assigning my class members to this structure elements like this:

CInitMenu::CInitMenu(irr::IrrlichtDevice* device)
{
 dev = device;
 gui::IGUIButton* m_pPlayButton = device->getGUIEnvironment()->addButton(core::recti(x,y,x+width,y+height),0,PLAY_BUTTON,L"Play");
  gui::IGUIButton* m_pOptionsButton = device->getGUIEnvironment()->addButton(core::recti(x,y,x+width,y+height),0,OPTIONS_BUTTON,L"Options");
  gui::IGUIButton* m_pCreditsButton = device->getGUIEnvironment()->addButton(core::recti(x,y,x+width,y+height),0,CREDITS_BUTTON,L"Credits");
  gui::IGUIButton* m_pExitButton = device->getGUIEnvironment()->addButton(core::recti(x,y,x+width,y+height),0,EXIT_BUTTON,L"Exit");
 initMnuContext.device = device;
 initMnuContext.m_pPlayButton = m_pPlayButton;
 initMnuContext.m_pOptionsButton = m_pOptionsButton;
 initMnuContext.m_pCreditsButton = m_pCreditsButton;
 initMnuContext.m_pExitButton = m_pExitButton;


What modifications has to be done to get code work?
AnswerRe: Error 2758 Pin
Sauro Viti25-Aug-10 23:57
professionalSauro Viti25-Aug-10 23:57 
GeneralRe: Error 2758 Pin
T.RATHA KRISHNAN26-Aug-10 0:06
T.RATHA KRISHNAN26-Aug-10 0:06 
QuestionUpdate WM_PAINT and Memory DC Pin
HTT9025-Aug-10 22:36
HTT9025-Aug-10 22:36 
AnswerRe: Update WM_PAINT and Memory DC Pin
Niklas L25-Aug-10 23:04
Niklas L25-Aug-10 23:04 
GeneralRe: Update WM_PAINT and Memory DC Pin
HTT9025-Aug-10 23:18
HTT9025-Aug-10 23:18 
GeneralRe: Update WM_PAINT and Memory DC Pin
Niklas L25-Aug-10 23:22
Niklas L25-Aug-10 23:22 
GeneralRe: Update WM_PAINT and Memory DC Pin
HTT9025-Aug-10 23:41
HTT9025-Aug-10 23:41 
GeneralRe: Update WM_PAINT and Memory DC Pin
JohnCz8-Sep-10 18:24
JohnCz8-Sep-10 18:24 
QuestionHow to get character count Pin
raju_shiva25-Aug-10 22:25
raju_shiva25-Aug-10 22:25 
AnswerRe: How to get character count Pin
HTT9025-Aug-10 22:38
HTT9025-Aug-10 22:38 
AnswerRe: How to get character count Pin
Sauro Viti25-Aug-10 22:48
professionalSauro Viti25-Aug-10 22:48 
AnswerRe: How to get character count Pin
Richard MacCutchan25-Aug-10 23:04
mveRichard MacCutchan25-Aug-10 23:04 
GeneralRe: How to get character count Pin
Sauro Viti25-Aug-10 23:17
professionalSauro Viti25-Aug-10 23:17 
GeneralRe: How to get character count Pin
Richard MacCutchan26-Aug-10 1:29
mveRichard MacCutchan26-Aug-10 1:29 
AnswerRe: How to get character count [modified] Pin
Niklas L25-Aug-10 23:09
Niklas L25-Aug-10 23:09 
GeneralRe: How to get character count Pin
CPallini26-Aug-10 0:38
mveCPallini26-Aug-10 0:38 
GeneralRe: How to get character count Pin
Niklas L26-Aug-10 0:52
Niklas L26-Aug-10 0:52 

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.