C
Chris Yates
Hello, why wont this work?
#define MAKEGET(t, n) t get##n() const { return this->n; }
#define MAKESET(t, n) void set##n(const t n) { this->n = n; }
#define MAKEGETSET(t, n) MAKEGET(t, n) MAKESET(t, n)
class cSys
{
private:
HWND hWnd_Main;
HWND hWnd_Func;
HWND hWnd_FuncEdit;
HINSTANCE hInst;
public:
cSys(HINSTANCE hInstance);
MAKEGETSET(HWND, hWnd_FuncEdit);
MAKEGETSET(HINSTANCE, hInst);
};
cSys *sys;
sys = new cSys();
sys->sethWnd_Main((HWND)1);
HWND res = sys->gethWnd_Main();
It compiles okay, and the set method seems to work fine, but the get method
gives an access violation. Thanks.
#define MAKEGET(t, n) t get##n() const { return this->n; }
#define MAKESET(t, n) void set##n(const t n) { this->n = n; }
#define MAKEGETSET(t, n) MAKEGET(t, n) MAKESET(t, n)
class cSys
{
private:
HWND hWnd_Main;
HWND hWnd_Func;
HWND hWnd_FuncEdit;
HINSTANCE hInst;
public:
cSys(HINSTANCE hInstance);
MAKEGETSET(HWND, hWnd_FuncEdit);
MAKEGETSET(HINSTANCE, hInst);
};
cSys *sys;
sys = new cSys();
sys->sethWnd_Main((HWND)1);
HWND res = sys->gethWnd_Main();
It compiles okay, and the set method seems to work fine, but the get method
gives an access violation. Thanks.