home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #31 / NN_1992_31.iso / spool / comp / lang / cplus / 18354 < prev    next >
Encoding:
Text File  |  1992-12-23  |  1.6 KB  |  39 lines

  1. Newsgroups: comp.lang.c++
  2. Path: sparky!uunet!rational.com!thor!rmartin
  3. From: rmartin@thor.Rational.COM (Bob Martin)
  4. Subject: Re: Access non-static data members in Motif callback functions.
  5. Message-ID: <rmartin.725129642@thor>
  6. Sender: news@rational.com
  7. Organization: Rational
  8. References: <1992Dec21.144344.21100@asl.dl.nec.com>
  9. Date: Wed, 23 Dec 1992 16:54:02 GMT
  10. Lines: 27
  11.  
  12. jng@aslslc71.asl.dl.nec.com (James Ng) writes:
  13.  
  14. |We use X11/R4 and Motif 1.1 for our GUI development. Our C++ compiler is
  15. |Object Center C++ (formerly called Saber C++). When we try to use a
  16. |non-static member function as a callback, sometimes nonstatic data members
  17. |get corrupted inside the callback function. Static data members seem to
  18. |maintain their integrity. Does anyone have similar experience or even
  19. |solution to solve the above problem? Any suggestion will be appreciated.
  20. |Suggestion can be mailed to jng@asl.dl.nec.com or posted if you prefer.
  21.  
  22. Callbacks cannot be non-static member functions unless the caller
  23. knows the exact type of the member function to be called.  Typically
  24. in GUI callbacks this is not the case.
  25.  
  26. Remember that a pointer to a member function IS NOT a pointer to a
  27. normal functions.  There is much more information being jockeyed
  28. around when pointers to member functions are involved.  
  29.  
  30. I recommend that you read the section of your favorite C++ book which
  31. describes pointers to members....
  32.  
  33.  
  34. --
  35. Robert Martin                        Training courses offered in:
  36. R. C. M. Consulting                       Object Oriented Analysis
  37. 2080 Cranbrook Rd.                        Object Oriented Design
  38. Green Oaks, Il 60048 (708) 918-1004       C++
  39.