home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #16 / NN_1992_16.iso / spool / comp / lang / cplus / 11447 < prev    next >
Encoding:
Text File  |  1992-07-23  |  1.2 KB  |  39 lines

  1. Newsgroups: comp.lang.c++
  2. Path: sparky!uunet!zaphod.mps.ohio-state.edu!sol.ctr.columbia.edu!src.honeywell.com!nuntius
  3. From: Jamie Billing-Ross <bross@src.honeywell.com>
  4. Subject: Passing C++ member functions to C functions
  5. Message-ID: <1992Jul24.005047.3397@src.honeywell.com>
  6. Sender: news@src.honeywell.com (News interface)
  7. Nntp-Posting-Host: bross.sso.az.honeywell.com
  8. Organization: Honeywell Satellite Systems Operation
  9. X-Useragent: Nuntius v1.1b1
  10. Date: Fri, 24 Jul 1992 00:50:47 GMT
  11. Lines: 26
  12.  
  13. This is similar to a problem I have seen stated but I haven't seen an
  14. answer to quite this one.
  15.  
  16. I have a C routine defined as follows:
  17.  
  18. extern "C" void add_ext_int_func(int level, int (*ptrfunc)());
  19.  
  20. Normally I just pass a C interrupt handler function as the 2nd argument
  21.  
  22. add_ext_int_funct(2,timer_int);
  23.  
  24. What I would like to do is pass a member function to this same routine..
  25.  
  26. add_ext_int_funct(2,CCclock::timer_int);
  27.  
  28. where the call is made from inside another member function of CCclock.
  29. if I typecast the member function,ie (int(*)())CCclock::timer_int I seem
  30. to get only the function offset address rather than the absolute entry
  31. point address..
  32.  
  33. So I am looking for any suggestions for converting from int(Class::*)() to
  34. a int(*)()
  35.  
  36. Thanks
  37.  
  38. Jamie
  39.