Click here to Skip to main content
15,891,704 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
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 
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 
Ok I decided to make both arrays static so that I wouldn't have to use any class instances to access them. Plus it boads better for my program to do it this way since all of the member functions that the array uses are already static.Now I know that static variable (even global ones) are only known within the file that it is declared in. Here is what I did:

Within my Header file I declare the 2 arrays as static:

<br />
	static void (*call_cmd_function[160])();<br />
	static void (*call_ins_function[48])();<br />


Then I define them at the top of the source files where I reference them:

<br />
void (CflowlogDlg::*call_cmd_function[160])() = {NULL}; //goes into flowlogcmds.cpp<br />
void (CflowlogDlg::*call_ins_function[48])() = {NULL};  //goes into flowlogins.cpp<br />


When I compile I get unresolved external symbol errors:

<br />
flowlogcmds.obj : error LNK2001: unresolved external symbol "public: static void (__cdecl** CflowlogDlg::call_cmd_function)(void)" (?call_cmd_function@CflowlogDlg@@2PAP6AXXZA)<br />
flowlogins.obj : error LNK2001: unresolved external symbol "public: static void (__cdecl** CflowlogDlg::call_ins_function)(void)" (?call_ins_function@CflowlogDlg@@2PAP6AXXZA)<br />


neither are referenced outside of its file, so I dont know why I am getting the Linker errors.
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 
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 

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.