I want to generate many sub-class which only has little difference, so I want to use macro to simplify my job. The macro define below:
#define DECLARE_SUB_CLASS(sub_class_name, base_class_name, value1) \
class sub_class_name:base_class_name \
{ \
public: \
virtual int initialize(const void *); \
virtual int run(const void *); \
virtual void reset(); \
virtual int output(const char*); \
virtual void terminate(); \
private: \
static const char m_szValue=#value1; \
};
I use it like this:
DECLARE_SUB_CLASS(RTCount13, RTCountBase, 13);
when I compiling with VC2005, it say
error C2065: 'RTCount13' : undeclared identifier
what's the problem?