Original Post
Okay, anyone that can help me with my following problem?
I am writing a class to handle all of my errors. One thing I want though, is for this class to be completely platform independent. So, I don't want to be doing any MessageBoxes or PostQuitMessages in it. However, I want the programmer to be able to set the function of how they will handle errors, which, when an error gets sent to the errorhandler class, it will then pass it along to their function... Here is some of the code:
anyways, when I compile this, I get the following Error Message:
ErrorMessenger.obj : error LNK2001: unresolved external symbol "private: static void (__cdecl* ErrorMessenger::m_ErrorFunction)(char *,bool)" (?m_ErrorFunction@ErrorMessenger@@0P6AXPAD_N@ZA)
Pointing to where I initialize m_ErrorFunction.
Any ideas as to what I am doing wrong?? I would greatly appreciate your help!!
Thank you,
Mihkael
Edited by - Mihkael on 8/27/00 12:23:27 AM
//ERRORMESSENGER.H
#ifndef ERRORMESSENGER_H
#define ERRORMESSENGER_H
typedef void(*FunctionPtr)(char*, bool);
class ErrorMessenger
{
public:
static void SetHandler(FunctionPtr Handler);
ErrorMessenger();
~ErrorMessenger();
private:
static FunctionPtr m_ErrorFunction;
};
void HolderFunction(char *szTemp, char *bTemp);
#endif
//
//ERRORMESSENGER.CPP
#include "ErrorMessenger.h"
//Static Member Initialization - Also spot of error it seems
FunctionPtr m_ErrorFunction = Holder;
ErrorMessenger::ErrorMessenger()
{//Empty
}
ErrorMessenger::~ErrorMessenger()
{//Empty
}
void ErrorMessenger::SetHandler(FunctionPtr Handler)
{
m_ErrorFunction = Handler;
}
void Holder(char * szTemp, bool bTemp)
{
}
|