Click here to Skip to main content
15,911,785 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionCBitmap CreateBitmapIndirect() fails Pin
Vaclav_20-Dec-08 13:09
Vaclav_20-Dec-08 13:09 
AnswerRe: CBitmap CreateBitmapIndirect() fails Pin
Stuart Dootson20-Dec-08 13:19
professionalStuart Dootson20-Dec-08 13:19 
GeneralRe: CBitmap CreateBitmapIndirect() fails Pin
Vaclav_20-Dec-08 15:21
Vaclav_20-Dec-08 15:21 
GeneralRe: CBitmap CreateBitmapIndirect() fails Pin
Jijo.Raj20-Dec-08 15:33
Jijo.Raj20-Dec-08 15:33 
AnswerRe: CBitmap CreateBitmapIndirect() fails Pin
Mark Salsbery21-Dec-08 5:24
Mark Salsbery21-Dec-08 5:24 
GeneralRe: CBitmap CreateBitmapIndirect() fails Pin
Vaclav_21-Dec-08 6:06
Vaclav_21-Dec-08 6:06 
GeneralRe: CBitmap CreateBitmapIndirect() fails Pin
Mark Salsbery22-Dec-08 6:46
Mark Salsbery22-Dec-08 6:46 
QuestionC2244 and inheritance error Pin
mjackson1120-Dec-08 10:01
mjackson1120-Dec-08 10:01 
I have a simple base class that holds id's for use in sorting other classes. It is a non-templated class in an single hpp file ( indexedObject, see below )

class indexedObject
{
public:
indexedObject() : _mID(BAD_DB_ID) {}
indexedObject(dbID id) : _mID(id) {}
~indexedObject();

dbID getID(void);
void setID(dbID id);

bool operator<(const dbID& param) const;
bool operator>(const dbID& param) const;
bool operator==(const dbID& param) const;
bool operator!=(const dbID& param) const;

protected:
dbID _mID;
}; // indexedObject

inline indexedObject::~indexedObject() { _mID = BAD_DB_ID; }

inline dbID indexedObject::getID(void) { return _mID; }

inline void indexedObject::setID(dbID id) { _mID = id; }

inline bool indexedObject::operator<(const dbID& param) const
{
return (_mID < param);
}

inline bool indexedObject::operator>(const dbID& param) const
{
return (_mID > param);
}

inline bool indexedObject::operator==(const dbID& param) const
{
return (_mID == param);
}

inline bool indexedObject::operator!=(const dbID& param) const
{
return (_mID != param);
}


I have a templated class that inherits from the base class.

template <class _Ty> class fwdCurve : public indexedObject, public broadCaster
{
blah blah...
}

When I try to define setID in the derived class

template<class _Ty> void fwdCurve<_Ty>::setID(dbID id)

I get a C2244: indexedObject::setID : unable to match function definition to an existing declaration

I am able to work around this by declaring setID() in the derived class definition and explicitly calling the base class method but why is this happening?

I have VS 2005 with SP1 and hotfix KB930859 installed.
AnswerRe: C2244 and inheritance error Pin
Stuart Dootson20-Dec-08 10:24
professionalStuart Dootson20-Dec-08 10:24 
GeneralRe: C2244 and inheritance error Pin
mjackson1120-Dec-08 10:45
mjackson1120-Dec-08 10:45 
GeneralRe: C2244 and inheritance error Pin
Stuart Dootson20-Dec-08 13:02
professionalStuart Dootson20-Dec-08 13:02 
GeneralRe: C2244 and inheritance error Pin
Stuart Dootson21-Dec-08 0:04
professionalStuart Dootson21-Dec-08 0:04 
GeneralRe: C2244 and inheritance error Pin
mjackson1121-Dec-08 5:41
mjackson1121-Dec-08 5:41 
GeneralRe: C2244 and inheritance error Pin
Mark Salsbery21-Dec-08 5:29
Mark Salsbery21-Dec-08 5:29 
QuestionmciSendString problem Pin
CS92520-Dec-08 8:51
CS92520-Dec-08 8:51 
AnswerRe: mciSendString problem Pin
L. Madhavan20-Dec-08 18:44
L. Madhavan20-Dec-08 18:44 
GeneralRe: mciSendString problem Pin
CS92521-Dec-08 5:45
CS92521-Dec-08 5:45 
Questionerror with Coin3d & AMD. Pin
saagh20-Dec-08 4:09
saagh20-Dec-08 4:09 
AnswerRe: error with Coin3d & AMD. Pin
Randor 20-Dec-08 9:36
professional Randor 20-Dec-08 9:36 
GeneralRe: error with Coin3d & AMD. Pin
saagh20-Dec-08 19:56
saagh20-Dec-08 19:56 
QuestionLogging stopped after CFileDialog::DoModal() invoking Pin
Igor IP20-Dec-08 2:48
professionalIgor IP20-Dec-08 2:48 
AnswerRe: Logging stopped after CFileDialog::DoModal() invoking Pin
Jijo.Raj20-Dec-08 3:06
Jijo.Raj20-Dec-08 3:06 
GeneralRe: Logging stopped after CFileDialog::DoModal() invoking Pin
Igor IP20-Dec-08 6:08
professionalIgor IP20-Dec-08 6:08 
QuestionRe: Logging stopped after CFileDialog::DoModal() invoking Pin
David Crow20-Dec-08 6:33
David Crow20-Dec-08 6:33 
GeneralRe: Logging stopped after CFileDialog::DoModal() invoking Pin
Jijo.Raj20-Dec-08 8:42
Jijo.Raj20-Dec-08 8:42 

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.