|
One build one Single documnet (single document project)
2. Put the add (int a, int b) function in the view cpp (don't forget to declare)
int add (int a, int b)
{
int ss;
ss = a + b;
return ss;
}
Three call it in void CDrawTextView :: OnDraw (CDC * pDC) function
void CDrawTextView :: OnDraw (CDC * pDC)
{
CDrawTextDoc * pDoc = GetDocument ();
ASSERT_VALID (pDoc);
CString str;
str.Format ("% d", add (2,4));
pDC-> TextOut (1,1, str);
// TODO: add draw code for native data here
} |
|