The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
Newsgroups: comp.lang.c++
From: lil...@dcccd.edu
Date: Tue, 16 Jun 2009 12:38:14 -0500
Local: Tues, Jun 16 2009 1:38 pm
Subject: Function pointer, is this possible?
Hopefully I can describe this in a clear manner.
I've created a button class with private member (int) (* func) (void); This is set using void BTN::SetFunction(int (*fnc)(void)) } This compiles fine. The problem comes when I use SetFunction to assign the function I want to run. Under straight forward circumstances this should compile fine. However, the function I want to set it to is a public member of another class object, bg of class Grid. btnNew.SetFunction ( bg.SetNewMode ); But I get a repremand to "use '&Grid::SetNewMode' to create a pointer to member" Does this mean that I can only specify a static function of a class? -- You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
| ||||||||||||||