Click here to Skip to main content
15,895,142 members
Home / Discussions / ATL / WTL / STL
   

ATL / WTL / STL

 
AnswerRe: Getting AppData Directory Path Pin
MicroVirus6-Sep-11 1:28
MicroVirus6-Sep-11 1:28 
GeneralRe: Getting AppData Directory Path Pin
jwalker3436-Sep-11 5:44
jwalker3436-Sep-11 5:44 
GeneralRe: Getting AppData Directory Path Pin
MicroVirus6-Sep-11 15:31
MicroVirus6-Sep-11 15:31 
GeneralRe: Getting AppData Directory Path Pin
jwalker3437-Sep-11 16:03
jwalker3437-Sep-11 16:03 
Questionhelp me!!! Pin
zz526335731-Aug-11 5:30
zz526335731-Aug-11 5:30 
QuestionHow to use forms / dialog boxes with an ATL Project / BHO? Pin
abetterword23-Aug-11 4:22
abetterword23-Aug-11 4:22 
AnswerRe: How to use forms / dialog boxes with an ATL Project / BHO? Pin
MicroVirus6-Sep-11 2:06
MicroVirus6-Sep-11 2:06 
QuestionFailure to Recognise Base Class [modified] Pin
Bram van Kampen19-Aug-11 13:47
Bram van Kampen19-Aug-11 13:47 
Hi,

I have created a Class CProgressDlg, derived from CDialog, which encapsulates the thread creation, message sending, cancel button, etc. associated a Dialog with one or more Progress Bar(s). The whole lot was compiled into an MFC Extension DLL, and I wrote an equivalent Header file which hides all the uglies needed to implement the class.

The exposed Class Declaration is as follows:
-
C++
class CProgressDlg : public CDialog
{
	DECLARE_DYNAMIC( CProgressDlg )
	virtual ~CProgressDlg();
// Operations
public:
	PFN_DLG_PROGRESS_THREADPROC SetProgressProcedure(PFN_DLG_PROGRESS_THREADPROC pFn);
	void OnCancel();
	BOOL ShouldTerminate();
	CProgressDlg(UINT nIDTemplate,CWnd* pParent =NULL);   // standard constructor
protected:
	virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV support
	void UpdateData(BOOL bSaveAndValidate = TRUE);
	void EndDialog(int ExitCode);
	virtual BOOL OnInitDialog();
	DECLARE_MESSAGE_MAP()
//Implementation
private:
	char Reserved[16];

};


I Tried to Use this code as Follows:-

C++
class CBackupDlg : public CProgressDlg
{
// Construction
public:
	DWORD ProcessAllFiles(void*);
	CBackupDlg(CWnd* pParent = NULL);   // standard constructor
// Dialog Data
	//{{AFX_DATA(CProcessBackupDlg)
	enum { IDD = IDD_ACTIONDLG };
	CProgressCtrl	m_cProgressCtrl;
	CString	m_sDataRemainung;
	CString	m_sProcessStage;
	CString	m_sFileNowProcessing;
	CString	m_sTimeRemaining;
	//}}AFX_DATA

// Overrides
	// ClassWizard generated virtual function overrides
	//{{AFX_VIRTUAL(CBackupDlg)
	protected:
	virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV support
	//}}AFX_VIRTUAL
// Implementation
protected:
	// Generated message map functions
	//{{AFX_MSG(CBackupDlg)
		// NOTE: the ClassWizard will add member functions here
	//}}AFX_MSG
	DECLARE_MESSAGE_MAP()
};

The CPP File has the Following :-
C++
CBackupDlg::CBackupDlg(CWnd* pParent /*=NULL*/)
	: CProgressDlg(CBackupDlg::IDD, pParent)
{
	//{{AFX_DATA_INIT(CProjectsBackupDlg)
          
//Lots of Stuff 

	// Note that LoadIcon does not require a subsequent DestroyIcon in Win32
	m_hIcon = AfxGetApp()->LoadIcon(IDR_MAINFRAME);
	m_qwCopySize=0;
}

// More Lots of Stuff

BEGIN_MESSAGE_MAP(CBackupDlg, CProgressDlg)
	//{{AFX_MSG_MAP(CProjectsBackupDlg)
	ON_WM_SYSCOMMAND()
	ON_WM_PAINT()
	ON_WM_QUERYDRAGICON()
	ON_BN_CLICKED(IDC_BROWSE_DEST, OnBrowseDest)
	ON_BN_CLICKED(IDC_BROWSE_SOURCE, OnBrowseSource)
	ON_BN_CLICKED(IDC_BROWSE_SUBDIR, OnBrowseSubdir)
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

// More Lots of Stuff

When Compiling I get the following Errors:-
At the Initialiser:
error C2614: 'CBackupDlg' : illegal member initialization: 'CProgressDlg' is not a base or member

At BEGIN_MESSAGE_MAP
error C2248: 'messageMap' : cannot access protected member declared in class 'CProgressDlg'

What is going on here. The Same Headers and Code has been used numerous times. The ProgressDlg Header is included via StdAfx.h, so, should be visible everywhere. I've gone over the code time and time again. Can't find anything out of Order.
By the way, Everything Compiles Fine if I replace CProgressDlg with CDialog in the Initialiser and the MESSAGE_MAP Macro. Ofcourse If I try to run with that, I get Run Time Errors as Expected.

Pulling out my hair at this stage, Any helpfull comment is appreciated.

Regards Smile | :)
Bram van Kampen
modified on Sunday, August 21, 2011 6:46 AM

AnswerRe: Failure to Recognise Base Class Pin
Richard MacCutchan20-Aug-11 0:23
mveRichard MacCutchan20-Aug-11 0:23 
GeneralRe: Failure to Recognise Base Class Pin
Bram van Kampen20-Aug-11 15:47
Bram van Kampen20-Aug-11 15:47 
GeneralRe: Failure to Recognise Base Class Pin
Richard MacCutchan20-Aug-11 23:32
mveRichard MacCutchan20-Aug-11 23:32 
AnswerRe: Failure to Recognise Base Class Pin
«_Superman_»22-Aug-11 13:14
professional«_Superman_»22-Aug-11 13:14 
QuestionCommon Controls Issue Pin
Tracy Software16-Aug-11 2:55
Tracy Software16-Aug-11 2:55 
Questioniterator default value [modified] Pin
liquid_5-Aug-11 1:34
liquid_5-Aug-11 1:34 
AnswerRe: iterator default value Pin
Stephen Hewitt6-Aug-11 20:40
Stephen Hewitt6-Aug-11 20:40 
GeneralRe: iterator default value Pin
liquid_7-Aug-11 9:18
liquid_7-Aug-11 9:18 
QuestionSOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\ Pin
VeganFanatic24-Jul-11 8:44
VeganFanatic24-Jul-11 8:44 
QuestionRe: SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\ Pin
Richard MacCutchan24-Jul-11 21:09
mveRichard MacCutchan24-Jul-11 21:09 
AnswerRe: SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\ Pin
VeganFanatic25-Jul-11 2:25
VeganFanatic25-Jul-11 2:25 
GeneralRe: SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\ Pin
Richard MacCutchan25-Jul-11 3:33
mveRichard MacCutchan25-Jul-11 3:33 
AnswerRe: SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\ Pin
MicroVirus6-Sep-11 2:18
MicroVirus6-Sep-11 2:18 
QuestionHelp regarding method WNetCancelConnection2 Pin
tasumisra18-Jul-11 23:42
tasumisra18-Jul-11 23:42 
AnswerRe: Help regarding method WNetCancelConnection2 Pin
Richard MacCutchan19-Jul-11 0:35
mveRichard MacCutchan19-Jul-11 0:35 
QuestionProblems with Docking Toolbars Pin
Syamlal S Nair18-Jul-11 17:59
Syamlal S Nair18-Jul-11 17:59 
QuestionCompiling with VS2010 Pin
Kyudos14-Jul-11 13:39
Kyudos14-Jul-11 13:39 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.