Click here to Skip to main content
15,888,527 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Clicking a windowless button programatically Pin
Green Fuze18-Apr-10 9:55
Green Fuze18-Apr-10 9:55 
GeneralRe: Clicking a windowless button programatically Pin
«_Superman_»18-Apr-10 10:01
professional«_Superman_»18-Apr-10 10:01 
GeneralRe: Clicking a windowless button programatically Pin
Green Fuze18-Apr-10 19:29
Green Fuze18-Apr-10 19:29 
GeneralRe: Clicking a windowless button programatically Pin
Keith Worden19-Apr-10 3:27
Keith Worden19-Apr-10 3:27 
GeneralRe: Clicking a windowless button programatically Pin
Green Fuze19-Apr-10 3:56
Green Fuze19-Apr-10 3:56 
Questionhow to embed the window of my program in the desktop?(The window is showed under the desktop icons.) [modified] Pin
letianzhu17-Apr-10 20:30
letianzhu17-Apr-10 20:30 
Questionset print area Pin
Amin.Abdi17-Apr-10 8:34
Amin.Abdi17-Apr-10 8:34 
QuestionSerialize in vc++ 2008 Pin
Wasabi_17-Apr-10 3:04
Wasabi_17-Apr-10 3:04 
Hi i want to serialize a class in c++. I got main class CElementy and other subclasses like CZamow it gives error like this:
Error 2 fatal error LNK1120: 1 unresolved externals
Error 1 error LNK2019: unresolved external symbol "protected: __thiscall CZamow::CZamow(void)" (??0CZamow@@IAE@XZ) referenced in function "public: static class CObject * __stdcall CZamow::CreateObject(void)" (?CreateObject@CZamow@@SGPAVCObject@@XZ) Elementy.obj

I think it is some kind of problem with inheritance the code goes like this:

Elementy.h
class CElementy : public CObject
{
DECLARE_SERIAL(CElementy)
protected:
COLORREF	m_Color;
CRect pz;
int m_Pen;
public:
	virtual ~CElementy();
	virtual void Draw(CDC *pDC, CElementy* pElement=0) {}
	virtual void Move(CSize& aSize){}
	virtual void Serialize(CArchive& ar);
	CRect Prst();
protected:
	CElementy(void);
};

class CZamow :
	public CElementy
{
DECLARE_SERIAL(CZamow)
public:
	~CZamow(void);
	virtual void Draw(CDC* pDC, CElementy* pElement);
	virtual void Serialize(CArchive& ar);
	CZamow(CPoint Pc, CPoint Kn, COLORREF aColor);

	protected:
	CPoint m_PunktP;
	CPoint m_PunktD;
	CZamow(void);
};


Elementy.cpp

#include "stdafx.h"
#include "VSM1.h"
#include "Stale.h"
#include "Elementy.h"
#include "math.h"

// CElementy
IMPLEMENT_SERIAL(CElementy, CObject, VERSION_NUMBER)
IMPLEMENT_SERIAL(CZamow, CElementy, VERSION_NUMBER)
CElementy::CElementy()
{
}

CElementy::~CElementy()
{
}
...

void CElementy::Serialize(CArchive& ar)
{
	CObject::Serialize(ar);
if (ar.IsStoring())
{
	ar << m_Color
		<< pz
		<< m_Pen;
}
else
{
	ar >> m_Color
		>> pz
		>> m_Pen;
}
}
..
CZamow::CZamow(CPoint Pc, CPoint Kn, COLORREF aColor)
{
	m_PunktD = Kn;
	Pc = (m_PunktD.x + 100, m_PunktD.y + 80);
	m_Color = aColor;
	m_Pen = 1;
	pz = CRect(Kn, Kn);
	pz.NormalizeRect();
}

CZamow::~CZamow(void)
{
}
..
void CZamow::Serialize(CArchive&ar)
{
	CElementy::Serialize(ar);
		if (ar.IsStoring())
		{
			ar << m_PunktP << m_PunktD;
		}
		else
		{
			ar >> m_PunktP >> m_PunktD;
		}
}

AnswerRe: Serialize in vc++ 2008 Pin
CPallini17-Apr-10 3:26
mveCPallini17-Apr-10 3:26 
GeneralRe: Serialize in vc++ 2008 Pin
Wasabi_17-Apr-10 3:30
Wasabi_17-Apr-10 3:30 
QuestionCalling Fns in formview Pin
hellogany16-Apr-10 23:58
hellogany16-Apr-10 23:58 
AnswerRe: Calling Fns in formview Pin
hellogany17-Apr-10 0:47
hellogany17-Apr-10 0:47 
QuestionCan you help me ? I need source code of a program like Total commander. Pin
thanhkhanhcntt16-Apr-10 15:18
thanhkhanhcntt16-Apr-10 15:18 
AnswerRe: Can you help me ? I need source code of a program like Total commander. PinPopular
Tim Craig16-Apr-10 17:50
Tim Craig16-Apr-10 17:50 
GeneralRe: Can you help me ? I need source code of a program like Total commander. Pin
thanhkhanhcntt16-Apr-10 20:15
thanhkhanhcntt16-Apr-10 20:15 
AnswerRe: Can you help me ? I need source code of a program like Total commander. Pin
Wes Aday16-Apr-10 18:04
professionalWes Aday16-Apr-10 18:04 
AnswerRe: Can you help me ? I need source code of a program like Total commander. Pin
jeron117-Apr-10 2:02
jeron117-Apr-10 2:02 
QuestionMessage Removed Pin
16-Apr-10 7:42
aruneshjoshi16-Apr-10 7:42 
QuestionRe: very urgent help needed in openmp Pin
Maximilien16-Apr-10 7:45
Maximilien16-Apr-10 7:45 
AnswerRe: very urgent help needed in openmp Pin
aruneshjoshi16-Apr-10 7:53
aruneshjoshi16-Apr-10 7:53 
AnswerRe: very urgent help needed in openmp Pin
loyal ginger16-Apr-10 7:54
loyal ginger16-Apr-10 7:54 
GeneralRe: very urgent help needed in openmp Pin
aruneshjoshi16-Apr-10 8:06
aruneshjoshi16-Apr-10 8:06 
QuestionRe: very urgent help needed in openmp Pin
David Crow16-Apr-10 8:29
David Crow16-Apr-10 8:29 
AnswerRe: very urgent help needed in openmp Pin
aruneshjoshi16-Apr-10 8:44
aruneshjoshi16-Apr-10 8:44 
GeneralRe: very urgent help needed in openmp Pin
rchrd16-Apr-10 9:26
rchrd16-Apr-10 9:26 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.