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

C / C++ / MFC

 
GeneralRe: saving and loading application settings Pin
John R. Shaw7-Jul-03 13:12
John R. Shaw7-Jul-03 13:12 
GeneralRe: saving and loading application settings Pin
John M. Drescher7-Jul-03 13:31
John M. Drescher7-Jul-03 13:31 
Generalgetting the value of an int in a cpp file into another Pin
keegan7-Jul-03 9:51
keegan7-Jul-03 9:51 
GeneralRe: getting the value of an int in a cpp file into another Pin
Navin7-Jul-03 9:59
Navin7-Jul-03 9:59 
GeneralRe: getting the value of an int in a cpp file into another Pin
keegan7-Jul-03 10:11
keegan7-Jul-03 10:11 
GeneralRe: getting the value of an int in a cpp file into another Pin
John R. Shaw7-Jul-03 10:05
John R. Shaw7-Jul-03 10:05 
GeneralRe: getting the value of an int in a cpp file into another Pin
keegan7-Jul-03 10:16
keegan7-Jul-03 10:16 
GeneralRe: getting the value of an int in a cpp file into another Pin
John R. Shaw7-Jul-03 10:41
John R. Shaw7-Jul-03 10:41 
1) This is for use in your header files if and only if you wish to declare the same external variable in multiple header files. You would use it as it appears.

// Start of MyHeader.h
... // unknown code here
#ifndef __G_IMYCURSEL__
#define __G_IMYCURSEL__
extern int g_iMyCurSel;
#endif
... // unknown code here
// End of MyHeader.h

2) If you are going to declare it in 1 and only 1 header file then use:

// Start of MyHeader.h
... // unknown code here
extern int g_iMyCurSel;
... // unknown code here
// End of MyHeader.h

If you only want to declare it only in .cpp file but it needs to be accessed inline inside 1 or more header file then you must do the following before including those header files:

// Start of MyCPPFile.c
... // unknown code here
extern int g_iMyCurSel;
#include "MyHeaderFile.h" // header needing g_iMyCurSel
... // unknown code here
// End of MyCPPFile.c


Trust in the code Luke. Yea right!
GeneralRe: Simpler answer Pin
John R. Shaw7-Jul-03 10:59
John R. Shaw7-Jul-03 10:59 
GeneralRe: getting the value of an int in a cpp file into another Pin
Michael Dunn7-Jul-03 17:19
sitebuilderMichael Dunn7-Jul-03 17:19 
GeneralRe: getting the value of an int in a cpp file into another Pin
Terry O'Nolley10-Jul-03 9:13
Terry O'Nolley10-Jul-03 9:13 
Questionhow to know if the VB function is part of COM object? Pin
mr20037-Jul-03 9:47
mr20037-Jul-03 9:47 
Generalfirewall project Pin
ub817-Jul-03 9:10
ub817-Jul-03 9:10 
GeneralRe: firewall project Pin
Dave Kreskowiak7-Jul-03 9:12
mveDave Kreskowiak7-Jul-03 9:12 
GeneralRe: firewall project Pin
basementman7-Jul-03 15:56
basementman7-Jul-03 15:56 
QuestionHow to use VB functions in VC program Pin
mr20037-Jul-03 9:10
mr20037-Jul-03 9:10 
AnswerRe: How to use VB functions in VC program Pin
AlexO7-Jul-03 9:11
AlexO7-Jul-03 9:11 
GeneralRe: How to use VB functions in VC program Pin
mr20037-Jul-03 9:14
mr20037-Jul-03 9:14 
GeneralRe: How to use VB functions in VC program Pin
Shaffiq7-Jul-03 18:26
Shaffiq7-Jul-03 18:26 
GeneralRe: How to use VB functions in VC program Pin
mr20038-Jul-03 7:32
mr20038-Jul-03 7:32 
GeneralRe: How to use VB functions in VC program Pin
Shaffiq8-Jul-03 20:34
Shaffiq8-Jul-03 20:34 
QuestionHow to get a HINSTANCE Pin
RvD20027-Jul-03 8:06
sussRvD20027-Jul-03 8:06 
AnswerRe: How to get a HINSTANCE Pin
AlexO7-Jul-03 8:39
AlexO7-Jul-03 8:39 
GeneralRe: How to get a HINSTANCE Pin
RvD20027-Jul-03 9:50
sussRvD20027-Jul-03 9:50 
AnswerRe: How to get a HINSTANCE Pin
John R. Shaw7-Jul-03 9:09
John R. Shaw7-Jul-03 9:09 

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.