Click here to Skip to main content
16,015,900 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Strange SetWindowText() under VS2003 Pin
Blake Miller14-Jun-05 5:51
Blake Miller14-Jun-05 5:51 
GeneralRe: Strange SetWindowText() under VS2003 Pin
toxcct20-Jun-05 20:38
toxcct20-Jun-05 20:38 
GeneralNeed help in RLC(Run-Length Coding)!!! Pin
Member 199230312-Jun-05 20:07
Member 199230312-Jun-05 20:07 
GeneralRe: Need help in RLC(Run-Length Coding)!!! Pin
Ravi Bhavnani13-Jun-05 6:37
professionalRavi Bhavnani13-Jun-05 6:37 
GeneralProblem in adding fifth digit to version number in VC++ 6.0 Pin
Neeranjan12-Jun-05 18:46
Neeranjan12-Jun-05 18:46 
GeneralRe: Problem in adding fifth digit to version number in VC++ 6.0 Pin
Blake Miller13-Jun-05 7:52
Blake Miller13-Jun-05 7:52 
GeneralRe: Problem in adding fifth digit to version number in VC++ 6.0 Pin
Neeranjan13-Jun-05 19:46
Neeranjan13-Jun-05 19:46 
GeneralC++ Array Of Function Pointers problem Pin
CNewbie12-Jun-05 18:21
CNewbie12-Jun-05 18:21 
I am trying to make an array of function pointers in C++. I have done it sucessfully in C, but I am having a problem with the arrays not giving defined correctly. Syntactically they are correct (or at least according to the compiler they are), but when it comes time to call the function, the arrays show that they are not defined with the functions that i am putting in the arrays.

Here is the declaration for both of my function pointer arrays that are public members of my "CDialog" class in my dialog.h file:

void (*functionarray1[48])();
void (*functionarray2[160])();

That file also houses the declarations for all of the functions I will use with the arrays.

Next I define the 2 arrays in my dialog.cpp file:

void (CDialog::*functionarray1[48])() = {CDialog::function1,CDialog::function2};
void (CDialog::*functionarray2[160])() = {CDialog::function3,CDialog::function4};

So according to this function1 should be in functionarray1[0]. function2 in functionarray1[1], etc... but at runtime when i run a debug the array never gets filled and I get an assertion error

Here is the code to call the function pointer based on an unknown offset value between 00h and 9Fh in "insptr":

CDialog FuncPtr;
UINT insptr = (INSNum / 2);
(FuncPtr.functionarray1[insptr])(); <-----------------

The assertion error happens when the line pointed to executes.

I took this syntax from a paper on C++ array of function pointers

if anyone can help, I'd really appreciate it.
GeneralRe: C++ Array Of Function Pointers problem Pin
GDavy12-Jun-05 19:34
GDavy12-Jun-05 19:34 
GeneralRe: C++ Array Of Function Pointers problem Pin
toxcct12-Jun-05 20:26
toxcct12-Jun-05 20:26 
GeneralRe: C++ Array Of Function Pointers problem Pin
Bob Stanneveld12-Jun-05 20:56
Bob Stanneveld12-Jun-05 20:56 
GeneralRe: C++ Array Of Function Pointers problem Pin
David Crow13-Jun-05 3:16
David Crow13-Jun-05 3:16 
GeneralRe: C++ Array Of Function Pointers problem Pin
CNewbie13-Jun-05 5:08
CNewbie13-Jun-05 5:08 
GeneralRe: C++ Array Of Function Pointers problem Pin
David Crow13-Jun-05 5:17
David Crow13-Jun-05 5:17 
GeneralRe: C++ Array Of Function Pointers problem Pin
CNewbie13-Jun-05 5:39
CNewbie13-Jun-05 5:39 
GeneralRe: C++ Array Of Function Pointers problem Pin
David Crow13-Jun-05 6:08
David Crow13-Jun-05 6:08 
GeneralRe: C++ Array Of Function Pointers problem Pin
CNewbie13-Jun-05 6:16
CNewbie13-Jun-05 6:16 
GeneralRe: C++ Array Of Function Pointers problem Pin
David Crow13-Jun-05 6:27
David Crow13-Jun-05 6:27 
GeneralRe: C++ Array Of Function Pointers problem Pin
CNewbie15-Jun-05 19:32
CNewbie15-Jun-05 19:32 
GeneralRe: C++ Array Of Function Pointers problem Pin
David Crow16-Jun-05 2:56
David Crow16-Jun-05 2:56 
GeneralRe: C++ Array Of Function Pointers problem Pin
CNewbie16-Jun-05 5:30
CNewbie16-Jun-05 5:30 
GeneralRe: C++ Array Of Function Pointers problem Pin
David Crow16-Jun-05 5:43
David Crow16-Jun-05 5:43 
GeneralRe: C++ Array Of Function Pointers problem Pin
CNewbie16-Jun-05 5:54
CNewbie16-Jun-05 5:54 
GeneralRe: C++ Array Of Function Pointers problem Pin
David Crow16-Jun-05 6:11
David Crow16-Jun-05 6:11 
GeneralRe: C++ Array Of Function Pointers problem Pin
CNewbie16-Jun-05 6:13
CNewbie16-Jun-05 6:13 

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.