in my .h I’ve got something like this:
class Cbeckhoff_frontendDlg : public CDialogEx
{
// construction
public:
Cbeckhoff_frontendDlg(CWnd* pParent = NULL);
//...
//this is the member object I want to create
Modul test;
};
And my .cpp looks like this:
Cbeckhoff_frontendDlg::Cbeckhoff_frontendDlg(CWnd* pParent /*=NULL*/)
: CDialogEx(Cbeckhoff_frontendDlg::IDD, pParent)
{
//..
};
//and should look like this:
Cbeckhoff_frontendDlg::Cbeckhoff_frontendDlg(CWnd* pParent /*=NULL*/)
: CDialogEx(Cbeckhoff_frontendDlg::IDD, pParent),test()
{
//..
};
I messed up the former test case I tried to publish here, I’m sorry about that. I guess I don’t quite understand what happens there. I assume Cbeckhoff_frontendDlg starts the parential CDialogEx- constructor, but I want to start my own constructor test aswell. Is that possible?
If
Modulhas a default constructor and you do not want to use another constructor, the following is already enough:If you want to use another constructor (e.g., one receiving an integer), you could do:
EDIT: As for the semicolons you should not use a semicolon after a method’s body: