Click here to Skip to main content
15,887,083 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: function pointer array problem Pin
kakan21-Feb-06 20:12
professionalkakan21-Feb-06 20:12 
AnswerRe: function pointer array problem Pin
Cedric Moonen21-Feb-06 20:13
Cedric Moonen21-Feb-06 20:13 
GeneralRe: function pointer array problem Pin
CastleIsle22-Feb-06 5:18
CastleIsle22-Feb-06 5:18 
AnswerRe: function pointer array problem Pin
Roger Stoltz22-Feb-06 5:53
Roger Stoltz22-Feb-06 5:53 
GeneralRe: function pointer array problem Pin
CastleIsle22-Feb-06 10:15
CastleIsle22-Feb-06 10:15 
AnswerRe: function pointer array problem Pin
Roger Stoltz21-Feb-06 22:35
Roger Stoltz21-Feb-06 22:35 
GeneralRe: function pointer array problem Pin
CastleIsle22-Feb-06 5:04
CastleIsle22-Feb-06 5:04 
AnswerRe: function pointer array problem Pin
Roger Stoltz22-Feb-06 5:23
Roger Stoltz22-Feb-06 5:23 
CastleIsle wrote:
MFC app compiler should have the same c/c++ rules as the console app compiler, but it doesn't.


Oh, yes it does. Smile | :)
This is not dependant on whether you are building a console app or an MFC app.
Since you are DEFINING the variable in a header file you will get errors if that header file is included in more than one source file. The linker will complain about multiple definitions.
You can have as many DECLARATIONS as you want, but you can only DEFINE a variable in one place.
Probably in your console project you have only one definition since the header file is included in one source file only, but several in your MFC app since the AppWiz includes each header file in more than one source file by default.
Tip of the day: never define variables in header files.;)

If you write your statement at the top of one single source file then the variable will be defined only once. Declare it as extern in the header file to be able to access in from other source files.

If this doesn't clear things up for you, post again and describe how and where you declare your variable and why.

--
Roger


It's supposed to be hard, otherwise anybody could do it!
GeneralRe: function pointer array problem Pin
CastleIsle22-Feb-06 5:48
CastleIsle22-Feb-06 5:48 
AnswerRe: function pointer array problem Pin
Roger Stoltz22-Feb-06 6:30
Roger Stoltz22-Feb-06 6:30 
Questionhow to get long file name (instead of old 8.3 notation) Pin
csc21-Feb-06 19:20
csc21-Feb-06 19:20 
AnswerRe: how to get long file name (instead of old 8.3 notation) Pin
Stephen Hewitt21-Feb-06 19:30
Stephen Hewitt21-Feb-06 19:30 
GeneralRe: how to get long file name (instead of old 8.3 notation) Pin
csc21-Feb-06 19:42
csc21-Feb-06 19:42 
QuestionHelp for Arabic/Urdu Development in Visual C++ Pin
signbit21-Feb-06 18:51
signbit21-Feb-06 18:51 
AnswerRe: Help for Arabic/Urdu Development in Visual C++ Pin
Rajesh R Subramanian21-Feb-06 19:00
professionalRajesh R Subramanian21-Feb-06 19:00 
AnswerRe: Help for Arabic/Urdu Development in Visual C++ Pin
Malli_S21-Feb-06 19:23
Malli_S21-Feb-06 19:23 
GeneralRe: Help for Arabic/Urdu Development in Visual C++ Pin
signbit21-Feb-06 19:39
signbit21-Feb-06 19:39 
GeneralRe: Help for Arabic/Urdu Development in Visual C++ Pin
Giannakakis Kostas22-Feb-06 1:43
professionalGiannakakis Kostas22-Feb-06 1:43 
Questionany predefined function to convert string to int Pin
namaskaaram21-Feb-06 18:27
namaskaaram21-Feb-06 18:27 
AnswerRe: any predefined function to convert string to int Pin
Ryan Binns21-Feb-06 18:44
Ryan Binns21-Feb-06 18:44 
GeneralRe: any predefined function to convert string to int Pin
namaskaaram21-Feb-06 19:06
namaskaaram21-Feb-06 19:06 
AnswerRe: any predefined function to convert string to int Pin
Stephen Hewitt21-Feb-06 18:54
Stephen Hewitt21-Feb-06 18:54 
AnswerRe: any predefined function to convert string to int Pin
James R. Twine22-Feb-06 2:18
James R. Twine22-Feb-06 2:18 
QuestionDrawing focus rect Pin
Naveen21-Feb-06 18:18
Naveen21-Feb-06 18:18 
AnswerRe: Drawing focus rect Pin
-Dy23-Feb-06 3:05
-Dy23-Feb-06 3:05 

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.