V
vasant63
Hi,
This is the compilation errors which I am getting when I compiling the
code with VC++ 6.0. The same code is getting compiled in Linux OS. I
would like to know how this compiler error can be eliminated?
d:\vasant\mysys\encoder\events.cpp(40) : error C2511: 'Register' :
overloaded member function 'void (enum EventType,void (__cdecl *)(enum
EventType,void *,void *),void *)' not found in 'EventManager'
d:\vasant\mysys\encoder\events.h(58) : see declaration of
'EventManager'
d:\vasant\mysys\encoder\events.cpp(54) : error C2511:
'CallbackRecord::CallbackRecord' : overloaded member function 'void
(enum EventType,void (__cdecl *)(enum EventType,void *,void *),void *)'
not found in 'CallbackRecord'
d:\vasant\mysys\encoder\events.h(68) : see declaration of
'CallbackRecord'
THE CONTENTS OF EVENTS.H
typedef void Callback (EventType, void*, void*);
class CallbackRecord;
class EventManager
{
public:
EventManager ();
void Register (EventType, Callback, void*);
void Trigger (EventType, void*);
private:
CallbackRecord* Callbacks[NumberEventTypes];
};
class CallbackRecord
{
public:
EventType type;
Callback* callback;
void* client_data;
CallbackRecord (EventType, Callback, void*);
};
THE CONTENTS OF EVENTS.CPP
void EventManager::Register (EventType t, Callback f, void* d)
{
CallbackRecord* crec = new CallbackRecord(t, f, d);
Callbacks[t] = crec;
}
CallbackRecord::CallbackRecord (EventType t, Callback c, void* d)
{
type = t;
callback = c;
client_data = d;
}
Thanks in advance.
Have a wonderful day.
With best wishes
Vasant
This is the compilation errors which I am getting when I compiling the
code with VC++ 6.0. The same code is getting compiled in Linux OS. I
would like to know how this compiler error can be eliminated?
d:\vasant\mysys\encoder\events.cpp(40) : error C2511: 'Register' :
overloaded member function 'void (enum EventType,void (__cdecl *)(enum
EventType,void *,void *),void *)' not found in 'EventManager'
d:\vasant\mysys\encoder\events.h(58) : see declaration of
'EventManager'
d:\vasant\mysys\encoder\events.cpp(54) : error C2511:
'CallbackRecord::CallbackRecord' : overloaded member function 'void
(enum EventType,void (__cdecl *)(enum EventType,void *,void *),void *)'
not found in 'CallbackRecord'
d:\vasant\mysys\encoder\events.h(68) : see declaration of
'CallbackRecord'
THE CONTENTS OF EVENTS.H
typedef void Callback (EventType, void*, void*);
class CallbackRecord;
class EventManager
{
public:
EventManager ();
void Register (EventType, Callback, void*);
void Trigger (EventType, void*);
private:
CallbackRecord* Callbacks[NumberEventTypes];
};
class CallbackRecord
{
public:
EventType type;
Callback* callback;
void* client_data;
CallbackRecord (EventType, Callback, void*);
};
THE CONTENTS OF EVENTS.CPP
void EventManager::Register (EventType t, Callback f, void* d)
{
CallbackRecord* crec = new CallbackRecord(t, f, d);
Callbacks[t] = crec;
}
CallbackRecord::CallbackRecord (EventType t, Callback c, void* d)
{
type = t;
callback = c;
client_data = d;
}
Thanks in advance.
Have a wonderful day.
With best wishes
Vasant