Click here to Skip to main content
15,916,019 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: C++ Array Of Function Pointers problem Pin
David Crow16-Jun-05 6:21
David Crow16-Jun-05 6:21 
GeneralRe: C++ Array Of Function Pointers problem Pin
CNewbie16-Jun-05 6:34
CNewbie16-Jun-05 6:34 
GeneralRe: C++ Array Of Function Pointers problem Pin
David Crow16-Jun-05 7:06
David Crow16-Jun-05 7:06 
GeneralRe: C++ Array Of Function Pointers problem Pin
CNewbie16-Jun-05 7:46
CNewbie16-Jun-05 7:46 
GeneralRe: C++ Array Of Function Pointers problem Pin
David Crow16-Jun-05 8:24
David Crow16-Jun-05 8:24 
GeneralRe: C++ Array Of Function Pointers problem Pin
CNewbie16-Jun-05 8:46
CNewbie16-Jun-05 8:46 
GeneralRe: C++ Array Of Function Pointers problem Pin
David Crow16-Jun-05 8:49
David Crow16-Jun-05 8:49 
GeneralRe: C++ Array Of Function Pointers problem Pin
coadtoad13-Jun-05 6:23
coadtoad13-Jun-05 6:23 
Your functions are public members. Are you initializing them in the .cpp file at the global scope or in a member function? If global, then I think that you are defining a new array that happens to have the same name as your member variable. You are not assigning values to your member array. Then when you call the function, the array is not initialized. Try this:

In your OnInitDialog():

// Init the functions pointers here
functionarray1[0] = CDialog::Func1 ;
functionarray1[1] = CDialog::Func2 ;

Later:
// call the functions
functionarray1[0]() ;
functionarray1[1]() ;

Make sure you declare Func1 and Func2 as static in CDialog.h

void (*functionarray1[48])();
void static Func1() ;
void static Func2() ;

Coadtoad
GeneralRe: C++ Array Of Function Pointers problem Pin
CNewbie13-Jun-05 11:49
CNewbie13-Jun-05 11:49 
GeneralRe: C++ Array Of Function Pointers problem Pin
coadtoad14-Jun-05 5:58
coadtoad14-Jun-05 5:58 
GeneralAccess variables in CMyView Pin
hcmuns12-Jun-05 17:26
susshcmuns12-Jun-05 17:26 
GeneralRe: Access variables in CMyView Pin
PJ Arends12-Jun-05 17:38
professionalPJ Arends12-Jun-05 17:38 
GeneralRe: Access variables in CMyView Pin
hcmuns12-Jun-05 17:49
susshcmuns12-Jun-05 17:49 
GeneralRe: Access variables in CMyView Pin
Tom Archer12-Jun-05 18:22
Tom Archer12-Jun-05 18:22 
GeneralRe: Access variables in CMyView Pin
hcmuns12-Jun-05 21:21
susshcmuns12-Jun-05 21:21 
GeneralRe: Access variables in CMyView Pin
hcmuns12-Jun-05 22:41
susshcmuns12-Jun-05 22:41 
QuestionDoes anyone know RLC? Pin
Member 199230312-Jun-05 17:12
Member 199230312-Jun-05 17:12 
GeneralMessage forwarding.... Pin
dobrzan12-Jun-05 11:20
dobrzan12-Jun-05 11:20 
GeneralSimple grid in a view Pin
scientist4712-Jun-05 10:22
scientist4712-Jun-05 10:22 
GeneralReturning a value from a Worker Thread Pin
Steve Messer12-Jun-05 8:41
Steve Messer12-Jun-05 8:41 
GeneralRe: Returning a value from a Worker Thread Pin
DavidR_r12-Jun-05 9:38
DavidR_r12-Jun-05 9:38 
GeneralRe: Returning a value from a Worker Thread Pin
Steve Messer12-Jun-05 10:29
Steve Messer12-Jun-05 10:29 
GeneralRe: Returning a value from a Worker Thread Pin
Tom Archer12-Jun-05 13:44
Tom Archer12-Jun-05 13:44 
GeneralRe: Returning a value from a Worker Thread Pin
Steve Messer12-Jun-05 16:38
Steve Messer12-Jun-05 16:38 
GeneralRe: Returning a value from a Worker Thread Pin
Tom Archer12-Jun-05 18:20
Tom Archer12-Jun-05 18:20 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.