Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Communication between Dialog and .cpp files with Singleton Pattern???

Status
Not open for further replies.

JasonDBurke

Programmer
Jun 20, 2001
54
US
Hello,
My question has been posted in many various ways and I still haven't gotten an answer but i'm very persistent. I'm gonna try and generalize my problem and not get specific. Basically my issue deals around how Dialogs created by the App Wizard can communicate with regular .cpp files. I have a workspace with multiple dialogs and multiple .cpp files in a single project. I have a .cpp file that has a DWORD WINAPI Main(void *pParam)function call and does some threading. I would like to send the information gathered by this thread back to the dialog. How can I do this without any architectural changes to the project? I can extern variables in the .cpp declared in the dialog and send info back that way however since this .cpp is a threaded app i need to constantly send information back to be updated and a button on the dialog box doesn't solve this. Somebody suggested using a Singleton pattern however I fail to see how this will solve my problem.. Someone please help me put 2 and 2 together. Thanx,
Jason
 
After adding a DialogBox, add with ClassWizard a class associated with it. All the code will be generated. Boxes data are associated with boxes hWnd, but when you're using MFC you don't need it. Just use wizard to put code in functions associated with different messages. Theese functions are named MessageHandlers. John Fill
1c.bmp


ivfmd@mail.md
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top