Create a class called Utils or whatever ,implement your commonly used procedures as static functions
And then you can call them from anywhere after included in
stdafx.h
Example :
Utils.h
class Utils
{
public:
static BOOL SaveTextToFile(CString strText,CWnd *pCaller);
}
Utils.cpp
#include "Utils.h"
BOOL Utils::SaveTextToFile(CString strText,CWnd *pCaller)
{
return TRUE;
}
Usage:
void MyDialogClass::OnBnClickedButtonABC()
{
BOOL bResult = Utils::SaveTextToFile(_T("Hello world"),this);
}
void MyOtherDialogClass::OnBnClickedButtonXYZ()
{
BOOL bResult = Utils::SaveTextToFile(_T("Hello world"),this);
}