home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.lang.c++
- Path: sparky!uunet!zaphod.mps.ohio-state.edu!sol.ctr.columbia.edu!src.honeywell.com!nuntius
- From: Jamie Billing-Ross <bross@src.honeywell.com>
- Subject: Passing C++ member functions to C functions
- Message-ID: <1992Jul24.005047.3397@src.honeywell.com>
- Sender: news@src.honeywell.com (News interface)
- Nntp-Posting-Host: bross.sso.az.honeywell.com
- Organization: Honeywell Satellite Systems Operation
- X-Useragent: Nuntius v1.1b1
- Date: Fri, 24 Jul 1992 00:50:47 GMT
- Lines: 26
-
- This is similar to a problem I have seen stated but I haven't seen an
- answer to quite this one.
-
- I have a C routine defined as follows:
-
- extern "C" void add_ext_int_func(int level, int (*ptrfunc)());
-
- Normally I just pass a C interrupt handler function as the 2nd argument
-
- add_ext_int_funct(2,timer_int);
-
- What I would like to do is pass a member function to this same routine..
-
- add_ext_int_funct(2,CCclock::timer_int);
-
- where the call is made from inside another member function of CCclock.
- if I typecast the member function,ie (int(*)())CCclock::timer_int I seem
- to get only the function offset address rather than the absolute entry
- point address..
-
- So I am looking for any suggestions for converting from int(Class::*)() to
- a int(*)()
-
- Thanks
-
- Jamie
-