c2039 visual c++ not a member of
Hi,
I have a problem accesing a member function of a class. Using MS Visual C++ i get the c2039 error everytime i try to acces a member function build by the program. Classes build by myself dont have this problem. The internet is full of reports about this bug but there's no answer on how to fix this problem.
Does anybody know how to fix this problem, it is really bothering me...
Thnx
visual c++ c2039 code of not a member function
Hi,
I posted the message (c other thread). Here follows the code causing the problem.
class containing the function......
Code:
class CDeleteWrd : public CDialog
{
// Construction
public:
CDeleteWrd(CWnd* pParent = NULL);
void SetPointer2Doc(CXMTrainerDoc* pD) {pDoc = pD;};
// Dialog Data
//{{AFX_DATA(CDeleteWrd)
enum { IDD = IDD_DELETEWORD };
CListBox m_ElemList;
//}}AFX_DATA
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CDeleteWrd)
protected:
virtual void DoDataExchange DataExchange*pDX);
// DDX/DDV support
//}}AFX_VIRTUAL
public:
// Implementation
protected:
CXMTrainerDoc* pDoc;
// Generated message map functions
//{{AFX_MSG(CDeleteWrd)
virtual BOOL OnInitDialog();
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
class calling function.....
void CXMTrainerView::OnWordlistDeleteword()
{
CXMTrainerDoc* pDoc = GetDocument();
CDeleteWrd dlg(this);
dlg.SetPointer2Doc(pDoc);
dlg.DoModal();
}
I tried to pass this pointer to the class by a (newly created )constructor, but then i get the message :constructor doesn't take 2 parameters.
Hope this is sufficient to explain the problem.
Thnx