![]() |
|
|
|
Thread Tools | Display Modes |
|
|
|
|
#1 |
|
Newbie
Join Date: Dec 2007
Posts: 28
Rep Power: 0
![]() |
Pointer to member function
Hello,
There is a quite problematic issue I would like to have solved. Consider an event handling function for a button. This function takes, among it's arguments, a pointer to a function, which it will execute if the button is pressed. Let's say I have a number of objects of class C, and I would like to do an operation on one of them if the button is pressed. I cannot pass "&object.operation" as a parameter to the button handling function, because the c++ standard doesn't allow that. Instead, I have to pass "&C::action". But passing this will not modify the one object I want to have modified when the user clicks on the button. Is there a way to pass a function pointer towards the method of THE object I want to modify? Thank you |
|
|
|
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Incompatible pointer type (double pointer in a function) | Gabriel Margarido | C | 16 | Nov 23rd, 2007 3:04 AM |
| Get member function address | Klarre | C++ | 3 | Mar 28th, 2007 6:34 AM |
| Function pointer to a member function | Jimbo | C++ | 3 | May 12th, 2006 4:53 PM |
| Need help writing a member function | Rawr101 | C++ | 3 | Apr 11th, 2006 3:18 AM |
| function pointer | raom | C | 9 | Nov 18th, 2005 2:42 PM |