..........hello there .....
..........after I compiled my following code ...
.......... I'd appreciate any help
// Day10View.cpp : implementation of the CDay10View class
//
void CDay10View::OnDraw(CDC* pDC)
{
CDay10Doc* pDoc = GetDocument();
ASSERT_VALID(pDoc);
// TODO: add draw code for native data here
///////////////////////
// MY CODE STARTS HERE
///////////////////////
// Get the number of lines in the document
int liCount = pDoc->GetLineCount(); // where the error occurs
// Are there any lines in the document?
if (liCount)
{
int liPos;
CLine*lptLine;
// Loop through the lines in the document
for (liPos = 0; liPos < liCount; liPos++)
{
// Get the from and to point for each line
lptLine = pDoc->GetLine(liPos); // where the error occurs
// Draw the line
lptLine->Draw(pDC);
}
}
///////////////////////
// MY CODE ENDS HERE
///////////////////////
}
void CDay10View::OnLButtonDown(UINT nFlags, CPoint point)
{
// TODO: Add your message handler code here and/or call default
CView::OnLButtonDown(nFlags, point);
}
void CDay10View::OnLButtonDown(UINT nFlags, CPoint point)
{
// TODO: Add your message handler code here and/or call default
///////////////////////
// MY CODE STARTS HERE
///////////////////////
// Capture the mouse, so no other application can
// grab it if the mouse leaves the window area
SetCapture();
// Save the point
m_ptPrevPos = point;
///////////////////////
// MY CODE ENDS HERE
///////////////////////
CView::OnLButtonDown(nFlags, point);
}
void CDay10View::OnLButtonUp(UINT nFlags, CPoint point)
{
// TODO: Add your message handler code here and/or call default
///////////////////////
// MY CODE STARTS HERE
///////////////////////
// Have we captured the mouse?
if (GetCapture() == this)
// If so, release it so other applications can
// have it
ReleaseCapture();
///////////////////////
// MY CODE ENDS HERE
///////////////////////
CView::OnLButtonUp(nFlags, point);
}
void CDay10View::OnMouseMove(UINT nFlags, CPoint point)
{
// TODO: Add your message handler code here and/or call default
///////////////////////
// MY CODE STARTS HERE
///////////////////////
// Check to see if the left mouse button is down
if ((nFlags & MK_LBUTTON) == MK_LBUTTON)
{
// Have we captured the mouse?
if (GetCapture() == this)
{
// Get the Device Context
CClientDC dc(this);
// Add the line to the document
CLine *pLine = GetDocument()->AddLine(m_ptPrevPos, point);
// Draw the current stretch of line
pLine->Draw(&dc);
// Save the current point as the previous point
m_ptPrevPos = point;
}
}
///////////////////////
// MY CODE ENDS HERE
///////////////////////
CView::OnMouseMove(nFlags, point);
}
-------------------Configuration: Day10 - Win32 Debug--------------------
Compiling...
Day10.cpp
Day10View.cpp
D:\VC++6\MSDev98\MyProjects\Day10\Day10View.cpp(76) : error C2039: 'GetLine' : is not a member of 'CDay10Doc'
d:\vc++6\msdev98\myprojects\day10\day10doc.h(13) : see declaration of 'CDay10Doc'
D:\VC++6\MSDev98\MyProjects\Day10\Day10View.cpp(78) : error C2027: use of undefined type 'CLine'
d:\vc++6\msdev98\myprojects\day10\day10doc.h(12) : see declaration of 'CLine'
D:\VC++6\MSDev98\MyProjects\Day10\Day10View.cpp(78) : error C2227: left of '->Draw' must point to class/struct/union
D:\VC++6\MSDev98\MyProjects\Day10\Day10View.cpp(138) : error C2084: function 'void __thiscall CDay10View::OnLButtonDown(unsigned int,class CPoint)' already has a body
D:\VC++6\MSDev98\MyProjects\Day10\Day10View.cpp(188) : error C2027: use of undefined type 'CLine'
d:\vc++6\msdev98\myprojects\day10\day10doc.h(12) : see declaration of 'CLine'
D:\VC++6\MSDev98\MyProjects\Day10\Day10View.cpp(188) : error C2227: left of '->Draw' must point to class/struct/union
Generating Code...
Compiling...
Day10Doc.cpp
Generating Code...
Error executing cl.exe.
Day10.exe - 6 error(s), 0 warning(s)
and here is Day10.cpp code......................................................
// Day10Doc.h : interface of the CDay10Doc class
//
/////////////////////////////////////////////////////////////////////////////
// Generated message map functions
protected:
//{{AFX_MSG(CDay10Doc)
// 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()
};
Code tags - please - you might not get any replies otherwise.
Also - perhaps this would be better on the windows page - there is a button so you can move there.
In the header file you have a GetLineCount but no GetLine as the compiler says. And you don't show any implementation for either of them ( not that I could see)