Hi, im working with a user defined dialog class derived from CDialog (using MFC, visual c++) and i'm trying to test a global function defined in a different implementation file that works in the background by having the dialog print informative messages to an edit box for runtime purposes. My dialog class has a member variable called m_sInfo and im using it to print information to the editbox like:

m_sInfo.Format("error in switch statement");
thing is it works fine if the function is not in a different .cpp file but im trying to encapsulate my code so i'd like to be able to do this. My alternative would be to send a newString into the function and have it store "error in switch statement" and return the string to the main .cpp file and then have something like :

m_sInfo.Format("%d", newString);
but that's pretty rugged if i want to print several things to the editbox before the function returns....i guess im not sure what to send into the function as an extra parameter to do this or maybe im going about this all wrong...

thanks for your help !