Right i managed to sort out most of the errors playing around and experimenting...There's just 3 left that are bugging me..The first two
So it says that "AssertValid" cannot be redeclared outside its class;Here is the code were i have redeclared it
Code:
// CSameGameView diagnostics
#ifdef _DEBUG
void CSameGameView::AssertValid() const
{ // It also expected a ";" before this point but i don't understand why ?
CView::AssertValid();
}
void CSameGameView::Dump(CDumpContext& dc) const
{
CView::Dump(dc);
}
CSameGameDoc* CSameGameView::GetDocument() const // non-debug version is inline
{
ASSERT(m_pDocument->IsKindOf(RUNTIME_CLASS(CSameGameDoc)));
return (CSameGameDoc*)m_pDocument;
}
#endif //_DEBUG
and here is the class it is declared in
Code:
#pragma once
class CSameGameView : public CView
{
protected: // create from serialization only
CSameGameView();
DECLARE_DYNCREATE(CSameGameView)
// Attributes
public:
CSameGameDoc* GetDocument() const;
// Operations
public:
// Overrides
public:
virtual void OnDraw(CDC* pDC); // overridden to draw this view
virtual BOOL PreCreateWindow(CREATESTRUCT& cs);
protected:
// Implementation
public:
void ResizeWindow();
virtual ~CSameGameView();
#ifdef _DEBUG
virtual void AssertValid() const;
virtual void Dump(CDumpContext& dc) const;
#endif
protected:
// Generated message map functions
protected:
afx_msg void OnFilePrintPreview();
afx_msg void OnRButtonUp(UINT nFlags, CPoint point);
afx_msg void OnContextMenu(CWnd* pWnd, CPoint point);
DECLARE_MESSAGE_MAP()
public:
virtual void OnInitialUpdate();
};
#ifndef _DEBUG // debug version in SameGameView.cpp
inline CSameGameDoc* CSameGameView::GetDocument() const
{ return reinterpret_cast<CSameGameDoc*>(m_pDocument); }
#endif
I hope my explanation is clear,i have never spoke to anybody about coding so i'm unsure of what terminology to use. I will get there soon