Help please,
I have created this bit of code to illustrate my problem. I wish to pass the address of a member function as a parameter in the constructor of another class. In my example, I don't want X to have any knowledge of A or B. Is there anyway to pass the address without getting compile errors. The code is unmanaged (no clr).
typedef void(*DISP)(char*); class X { public: DISP disp; X(DISP pdisp) { disp = pdisp; } X() {} }; class A { public: X *ax; A() { ax = new X(&display); }; void display(char * msg){ } }; class B { public: X *bx; B() { bx = new X(&display); }; void display(char * msg){ } }; int main() { A a; B b; };