hello guys ..... can any body help me???

I have a project on visual C++ and i got some errors in my program
I need your help
my Code is....
// Day10Doc.h : interface of the CDay10Doc class
//
/////////////////////////////////////////////////////////////////////////////

#if !defined(AFX_DAY10DOC_H__A12642CF_7E96_4273_B3B5_FA94CD497BEC__INCLUDED_)
#define AFX_DAY10DOC_H__A12642CF_7E96_4273_B3B5_FA94CD497BEC__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000


class CDay10Doc : public CDocument
{
protected: // create from serialization only
CDay10Doc();
DECLARE_DYNCREATE(CDay10Doc)

// Attributes
public:

// Operations
public:

// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CDay10Doc)
public:
virtual BOOL OnNewDocument();
virtual void Serialize(CArchive& ar);
//}}AFX_VIRTUAL

// Implementation
public:
int GetLineCount();
CLine* AddLine(CPoint ptFrom, CPoint ptTo);
CObArray m_oaLines;
virtual ~CDay10Doc();
#ifdef _DEBUG
virtual void AssertValid() const;
virtual void Dump(CDumpContext& dc) const;
#endif

protected:

// 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()
};

/////////////////////////////////////////////////////////////////////////////

//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.

#endif // !defined(AFX_DAY10DOC_H__A12642CF_7E96_4273_B3B5_FA94CD497BEC__INCLUDED_)

and the errors which I got are......

--------------------Configuration: Day10 - Win32 Debug--------------------
Compiling...
Day10.cpp
error C2143: syntax error : missing ';' before '*'
error C2501: 'CLine' : missing storage-class or type specifiers
error C2501: 'AddLine' : missing storage-class or type specifiers
Day10View.cpp
error C2143: syntax error : missing ';' before '*'
error C2501: 'CLine' : missing storage-class or type specifiers
error C2501: 'AddLine' : missing storage-class or type specifiers
error C2065: 'CLine' : undeclared identifier
error C2065: 'lptLine' : undeclared identifier
warning C4552: '*' : operator has no effect; expected operator with side-effect
error C2039: 'GetLine' : is not a member of 'CDay10Doc'
d:\vc++6\msdev98\myprojects\day10\day10doc.h(13) : see declaration of 'CDay10Doc'
error C2227: left of '->Draw' must point to class/struct/union
error C2084: function 'void __thiscall CDay10View::OnLButtonDown(unsigned int,class CPoint)' already has a body
error C2065: 'pLine' : undeclared identifier
error C2440: '=' : cannot convert from 'int *' to 'int'
This conversion requires a reinterpret_cast, a C-style cast or function-style cast
error C2227: left of '->Draw' must point to class/struct/union
Generating Code...
Error executing cl.exe.

Day10.exe - 14 error(s), 1 warning(s)
Last edited on
Where is CLine declared? You probably have to include the header where CLine is defined or use a forward declaration.
here where CLine is Declared.....

// Line.cpp: implementation of the CLine class.
//
//////////////////////////////////////////////////////////////////////

#include "stdafx.h"
#include "Day10.h"
#include "Line.h"

#ifdef _DEBUG
#undef THIS_FILE
static char THIS_FILE[]=__FILE__;
#define new DEBUG_NEW
#endif

//////////////////////////////////////////////////////////////////////
// Construction/Destruction
//////////////////////////////////////////////////////////////////////

CLine::CLine()
{

}

CLine::~CLine()
{

}

CLine::CLine(CPoint ptFrom, CPoint ptTo)
{
//Initialize the from and to points
m_ptFrom = ptFrom;
m_ptTo = ptTo;
}

void CLine::Draw(CDC *pDC)
{
// Draw the line
pDC->MoveTo(m_ptFrom);
pDC->LineTo(m_ptTo);
}
Topic archived. No new replies allowed.