I'm having hard time with MFC. Can someone help me?
My program have two dialogs in a resource (I generated it by using MFC App Wizard (EXE), then i added a second dialog).
Dialog 1 contains:
- A button with a caption "Add New String".
- A ListBox
Dialog 2 contains:
- A button with a caption "Add"
- An EditBox
So, when the program is started the first dialog is shown (DoModal).
When the user presses "Add New String", the second dialog come up where the user should enter it into the EditBox. Then when the "Add" button is pressed, the second dialog is closed (EndDialog) and the string is added to the ListBox on the first dialog.
I created a member varable (using Class Wizard) called "m_List1" for the ListBox (on dialog 1). But i cannot access it from my second dialog (SecondDLG.cpp). Why?
I tried to make an extern pointer to the first dialog, hoping to access the variable through it, but it doesn't work.
Any ideas? MFC is really driving me crazy...