Programming MSVC++ 5th edition
ex05a
Step #3 says Add a private ShotFont Helper function to the view class. Add the protype shown as before below in ex05aView.h:
private:
void ShowFont(CDC* pDC, int& nPos, int nPoints);
My question is why there specifically?
I had to look for the solution, no I want to know why there so I can learn and understand.
I was getting the error from the wizard saying it can not find the function untill it got saved at least once.
I save workspace, the program, even closed the program itself and reloaded it.
Can someone explain the reasoning and the logic behind where it has to be there and not just anywhere else.
I googled and used bing and dogpile and no acceptable to my understanding answer.
// ex05aView.h : interface of the CEx05aView class
//
/////////////////////////////////////////////////////////////////////////////
class CEx05aView : public CView
{
protected: // create from serialization only
CEx05aView();
DECLARE_DYNCREATE(CEx05aView)
// Attributes
public:
CEx05aDoc* GetDocument();
// Operations
public:
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CEx05aView)
public:
virtual void OnDraw(CDC* pDC); // overridden to draw this view
virtual BOOL PreCreateWindow(CREATESTRUCT& cs);
virtual void OnPrepareDC(CDC* pDC, CPrintInfo* pInfo = NULL);
//}}AFX_VIRTUAL
private:
void ShowFont(CDC* pDC, int& nPos, int nPoints);
// Implementation
public:
virtual ~CEx05aView();
virtual void AssertValid() const;
virtual void Dump(CDumpContext& dc) const;
protected:
// Generated message map functions
protected:
//{{AFX_MSG(CEx05aView)
// NOTE - the ClassWizard will add and remove member functions here.
// DO NOT EDIT what you see in these blocks of generated code !
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
inline CEx05aDoc* CEx05aView::GetDocument()
{ return (CEx05aDoc*)m_pDocument; }
/////////////////////////////////////////////////////////////////////////////
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
It looks like you're new here. If you want to get involved, click one of these buttons!