Should not declare variable in view.h ?
Hi All,
I want to declare two variable, int x, and int y for coordinates.
When keyboard event happen, I will change this coordinates.
I add the declaration into View.h:
// Boki personal
void Boki_updateXY(int x, int y);
int boki_x;
int boki_y;
and add a function for keydown events:
void Boki_updateXY(int x, int y)
{
boki_x=x;
boki_y=y;
}
but the error is:
error C2065: 'boki_x' : undeclared identifier
Could you please advice?
Thank you very much!
Best regards,
Boki.
////////// BokiView.h ///////////////
class CEasy2View : public CView
{
protected: // create from serialization only
CEasy2View();
DECLARE_DYNCREATE(CEasy2View)
....
....
// Boki personal
void Boki_updateXY(int x, int y);
int boki_x;
int boki_y;
....
....
// Generated message map functions
protected:
//{{AFX_MSG(CEasy2View)
afx_msg void OnKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags);
afx_msg void OnLButtonDown(UINT nFlags, CPoint point);
afx_msg void OnLButtonUp(UINT nFlags, CPoint point);
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};