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

C / C++ / MFC

 
GeneralRe: C2084 FUNCTION ALREADY HAS A BODY Pin
Albert Holguin18-Dec-16 17:02
professionalAlbert Holguin18-Dec-16 17:02 
GeneralRe: C2084 FUNCTION ALREADY HAS A BODY Pin
leon de boer18-Dec-16 16:31
leon de boer18-Dec-16 16:31 
AnswerRe: C2084 FUNCTION ALREADY HAS A BODY Pin
Richard MacCutchan18-Dec-16 21:48
mveRichard MacCutchan18-Dec-16 21:48 
GeneralRe: C2084 FUNCTION ALREADY HAS A BODY Pin
Peter_in_278018-Dec-16 23:09
professionalPeter_in_278018-Dec-16 23:09 
GeneralRe: C2084 FUNCTION ALREADY HAS A BODY Pin
Richard MacCutchan19-Dec-16 5:38
mveRichard MacCutchan19-Dec-16 5:38 
GeneralRe: C2084 FUNCTION ALREADY HAS A BODY Pin
leon de boer19-Dec-16 19:03
leon de boer19-Dec-16 19:03 
GeneralRe: C2084 FUNCTION ALREADY HAS A BODY Pin
Albert Holguin21-Dec-16 10:41
professionalAlbert Holguin21-Dec-16 10:41 
GeneralRe: C2084 FUNCTION ALREADY HAS A BODY Pin
leon de boer23-Dec-16 6:26
leon de boer23-Dec-16 6:26 
It's not the prototype and body that causes the problem it's the syntax to do it ... try it
#define BYTE char
#define BYTE unsigned char
// You will get warning 'BYTE': macro redefinition ON ANY C COMPILER THAT MEETS C87+ SPEC

You also can't have two typedefs try that as well
typedef char BYTE
typedef unsigned char BYTE
// You will get error 'BYTE': type redefinition ON ANY C COMPILER THAT MEETS C87+ SPEC

You also must have the typedef first and the macro second, try this reverse case and see what happens Smile | :)
#define BYTE char
typedef unsigned char BYTE
// It will expand to typedef unsigned char char .... good luck with that getting thru compiler

It is very specific and very annoying and painful, but it is that order typedef followed sometime later by a macro. Hence I know the order that it must be in.

Seen it and done it a number of times and it's really really annoying and makes you scratch your head.
In vino veritas


modified 23-Dec-16 12:49pm.

GeneralRe: C2084 FUNCTION ALREADY HAS A BODY Pin
Albert Holguin23-Dec-16 7:25
professionalAlbert Holguin23-Dec-16 7:25 
GeneralRe: C2084 FUNCTION ALREADY HAS A BODY Pin
leon de boer23-Dec-16 8:37
leon de boer23-Dec-16 8:37 
QuestionMFC code to move a train in two directions Pin
Member 1289526213-Dec-16 19:17
Member 1289526213-Dec-16 19:17 
AnswerRe: MFC code to move a train in two directions Pin
CPallini13-Dec-16 21:22
mveCPallini13-Dec-16 21:22 
AnswerRe: MFC code to move a train in two directions Pin
jeron114-Dec-16 4:40
jeron114-Dec-16 4:40 
GeneralRe: MFC code to move a train in two directions Pin
Richard MacCutchan14-Dec-16 5:08
mveRichard MacCutchan14-Dec-16 5:08 
GeneralRe: MFC code to move a train in two directions Pin
jeron114-Dec-16 5:11
jeron114-Dec-16 5:11 
SuggestionRe: MFC code to move a train in two directions Pin
David Crow14-Dec-16 5:36
David Crow14-Dec-16 5:36 
AnswerRe: MFC code to move a train in two directions Pin
Chris Losinger14-Dec-16 11:00
professionalChris Losinger14-Dec-16 11:00 
AnswerRe: MFC code to move a train in two directions Pin
Gerry Schmitz14-Dec-16 12:21
mveGerry Schmitz14-Dec-16 12:21 
AnswerRe: MFC code to move a train in two directions Pin
Patrice T14-Dec-16 12:45
mvePatrice T14-Dec-16 12:45 
AnswerRe: MFC code to move a train in two directions Pin
Munchies_Matt30-Dec-16 7:35
Munchies_Matt30-Dec-16 7:35 
QuestionTiny Encryption Algorithm Pin
Rhonnn12-Dec-16 20:42
Rhonnn12-Dec-16 20:42 
AnswerRe: Tiny Encryption Algorithm Pin
Jochen Arndt12-Dec-16 20:55
professionalJochen Arndt12-Dec-16 20:55 
AnswerRe: Tiny Encryption Algorithm Pin
Patrice T14-Dec-16 12:39
mvePatrice T14-Dec-16 12:39 
QuestionKnow when a child popup dialog is opened Pin
_Flaviu11-Dec-16 23:06
_Flaviu11-Dec-16 23:06 
SuggestionRe: Know when a child popup dialog is opened Pin
Richard MacCutchan11-Dec-16 23:18
mveRichard MacCutchan11-Dec-16 23:18 

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.