🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.os.msdos.programmer
Article #3086

TC++ Question: Casting member func to reg func

#3086
From: Evan Mills
Date: Fri, 16 Nov 1990 20:32
27 lines
1455 bytes
Hello.  I'm using the CXL function library from Turbo C++ and have run
into a snag.  I need to call a function which requires as a parameter
a pointer to a function returning a void like this:
	int setonkey(...,void (*func)(void),...);
If I declare a regular C function:
	void foobar(void);
and call:
	setonkey(...,foobar,...);
everything's peachy.

Now I want to call a class member function:
	class Anything {
		...
		void foobar(void);
		...
		};
The closest I seem to be able to come is:
	setonkey(...,Anything::foobar,...);
but even this fails.

Suggestions *heartily* welcomed!  Thanks in advance.
	--- Evan
-- 
                                          @@@@@@@@  @@@       @@@   @@@@@@@@
           EVAN MILLS                    @@@        @@@       @@@  @@@
 Programmer & Twin Peaks Fanatic         @@@        @@@       @@@  @@@
          (217) 244-5726                  @@@@@@@   @@@  @@@  @@@   @@@@@@@
Technical Details
Message-ID: <1990Nov16.203238.9409@ux1.cso.uiuc.edu>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!rutgers!dimacs.rutgers.edu!seismo!ukma!wuarchive!julius.cs.uiuc.edu!ux1.cso.uiuc.edu!emills

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!rutgers!dimacs.rutgers.edu!seismo!ukma!wuarchive!julius.cs.uiuc.edu!ux1.cso.uiuc.edu!emills
From: emills@ux1.cso.uiuc.edu (Evan Mills)
Newsgroups: comp.os.msdos.programmer
Subject: TC++ Question:  Casting member func to reg func
Keywords: C++, question
Message-ID: <1990Nov16.203238.9409@ux1.cso.uiuc.edu>
Date: 16 Nov 90 20:32:38 GMT
Sender: emills@ux1.cso.uiuc.edu (Evan Mills)
Distribution: usa
Organization: University of Illinois at Urbana
Lines: 27