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