View Single Post
  #1 (permalink)  
Old January 28th, 2016, 07:58 PM
BillLea BillLea is offline
Registered User
Points: 5, Level: 1
Points: 5, Level: 1 Points: 5, Level: 1 Points: 5, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jan 2016
Location: Tulsa Oklahoma
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default hOW TO ACCESS A CLASS EXTERNAL TO A dIALOG FRON INSIDE THE dIALOG

I raiase this question here as it pertains to code from the book. If this is the wrong forum please direct me to a more apporiate one.

I am tryinbg to rewrite an existing program into a thread based form. In this process I wanted to look at communicating with threads. I found the Logger class interesting and decided to convert it for use with a GUI based program.
I used Visual Studio 2015 community to greate a C++ MFC Dialoge based skeliton program. I added 3 button a and tyhree edit controls to the Dialog.
I copied the Logger.h and Logger.ccp files into the project and added the header files to the main ccp file. I instanciated the class outside the Dialog DoModal function and it works fine.

My problem is that I cannot figure out how to reach the logger.log("Message") function from the dialog with out the resort to a global variable. Since globals are said tobe a source of bugs could you poing out the method I need to access the member function of the class instanciated outside the Dialopg box?


Thanks
Nill Lea