views:

488

answers:

1

Hello,

Can someone please guide me on how to pass the reference pointer to the dialog class so that it can call DoModal?

e.g. EditorSvr.cpp -- implementation of the interface class (which is also located in a DLL) CDialogClass1.cpp -- Dialog class that will receive the pointer from EditorSvr.cpp

I tried to search the whole google but in futile. Can someone please help to advice? Thank you very much for your time and help.

-peace

+1  A: 

You want your CDialogClass1 object to have a member or pointer to your Dialog2 and do your creation of the dialog from CDialogClass1's member function.

class CDialogClass1 { CDialogClass2* dialog2;

CDialogClass1::CDialogClass1() { dialog2 = new CDialogClass2; }

void doSomething() { dialog2->DoModal(); }

}

KJAWolf
Sorry for my late reply. Yup that's what I want to do but the problem is i am not sure how to have create the pointer to my Dialog 2 and to call DoModal in CDialogClass1.
peace