Click here to Skip to main content
15,917,329 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: WinSock 2 / Win32 Pin
Moak19-Apr-10 4:09
Moak19-Apr-10 4:09 
GeneralRe: WinSock 2 / Win32 Pin
Spawn@Melmac19-Apr-10 4:27
Spawn@Melmac19-Apr-10 4:27 
GeneralRe: WinSock 2 / Win32 Pin
Fareed Rizkalla4-May-10 21:02
Fareed Rizkalla4-May-10 21:02 
GeneralRe: WinSock 2 / Win32 Pin
Spawn@Melmac5-May-10 0:13
Spawn@Melmac5-May-10 0:13 
Questionprevious next button to change pictures Pin
taouki18-Apr-10 7:04
taouki18-Apr-10 7:04 
AnswerRe: previous next button to change pictures Pin
cconklin18-Apr-10 7:07
cconklin18-Apr-10 7:07 
GeneralRe: previous next button to change pictures Pin
taouki18-Apr-10 7:10
taouki18-Apr-10 7:10 
AnswerRe: previous next button to change pictures Pin
loyal ginger18-Apr-10 7:41
loyal ginger18-Apr-10 7:41 
GeneralRe: previous next button to change pictures Pin
taouki18-Apr-10 7:54
taouki18-Apr-10 7:54 
GeneralRe: previous next button to change pictures Pin
loyal ginger18-Apr-10 9:03
loyal ginger18-Apr-10 9:03 
AnswerRe: previous next button to change pictures Pin
Maximilien18-Apr-10 8:01
Maximilien18-Apr-10 8:01 
QuestionRe: previous next button to change pictures Pin
David Crow19-Apr-10 3:30
David Crow19-Apr-10 3:30 
AnswerRe: previous next button to change pictures Pin
taouki23-Apr-10 23:50
taouki23-Apr-10 23:50 
QuestionClicking a windowless button programatically Pin
Green Fuze18-Apr-10 5:19
Green Fuze18-Apr-10 5:19 
AnswerRe: Clicking a windowless button programatically Pin
Member 321910418-Apr-10 6:40
Member 321910418-Apr-10 6:40 
AnswerRe: Clicking a windowless button programatically Pin
«_Superman_»18-Apr-10 7:52
professional«_Superman_»18-Apr-10 7:52 
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 

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.