[C++/Win32/WinXP/.NET7.0]
I'm trying to write a threading class for my socket library, and I get compiler errors every time I try to use a function pointer. This is the interface for the class:
begin() calls the CreateThread Win32 function, which in turn calls ThreadProc() (this is to get around the Windows problem with calling a member function).Code:class Threader : public ThreadABC { public: typedef void (*pf) (void); Threader( void (*pf) (void) ) : pfunction(pf) { begin(); } private: void (*pfunction) (void); void ThreadProc() { pfunction(); } };
This is the implementation that I try to use to instantiate the class:
This code brings up the compiler error C2276:Code:void (*pc) (void); pc = &(PackConnections); ConnectionPacker = new Threader( pc );
This error message points to the second line in the implementation (pc = &(PackConnections);).Code:error C2276: '&' : illegal operation on bound member function expression
Does anybody have any ideas?
Thanks



LinkBack URL
About LinkBacks


