Adding an MFC GUI to an existing command line program

Hey guys,

I have a background in few different languages but I am kind of new to C++ and I am really new to Windows programming. I have made a fairly sophisticated C++ program that I have been using the command line to operate. Now I want to add a very simple GUI, mostly for demonstration purposes. I have made a dialog based MFC application and build the interface using the tools provided in Visual Studio 2012. Now I’m stuck. How to I actually connect the generated classes to my programs classes? I see that the MFC wizard generated MyProgramDlg.cpp and MyProgram.cpp files. I assume that my program needs to be set up in MyProgram.cpp and then all of the GUI logic is handled MyProgramDlg.cpp? That’s what I have been trying to do anyhow, but I don’t know how to pass events back and forth between MyProgramDlg.cpp and MyProgram.cpp. For instance, in MyProgramDlg.cpp I get the value of an input box, I want to pass that value down to my program that is instantiated in the generated MyProgramDlg.cpp. And conversely, I want to pass events up from my program to MyProgramDlg.cpp. How is this done in MFC programs? I have looked in looked all around Google for answers and I cannot find anything that applies to my situation. Can someone explain this to me or point me in the right direction?

-Taylor
Topic archived. No new replies allowed.