Click here to Skip to main content
16,018,419 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionRe: 2 static libs with a function of the same name Pin
Chesnokov Yuriy10-Jan-10 1:51
professionalChesnokov Yuriy10-Jan-10 1:51 
AnswerRe: 2 static libs with a function of the same name [modified] Pin
Chris Losinger10-Jan-10 6:18
professionalChris Losinger10-Jan-10 6:18 
AnswerRe: 2 static libs with a function of the same name Pin
Chesnokov Yuriy10-Jan-10 6:29
professionalChesnokov Yuriy10-Jan-10 6:29 
GeneralRe: 2 static libs with a function of the same name Pin
Chris Losinger10-Jan-10 6:35
professionalChris Losinger10-Jan-10 6:35 
AnswerRe: 2 static libs with a function of the same name Pin
«_Superman_»10-Jan-10 15:35
professional«_Superman_»10-Jan-10 15:35 
QuestionWhat's the theory behind this: #ifdef __cplusplus extern "C" { Pin
Danzy839-Jan-10 22:49
Danzy839-Jan-10 22:49 
AnswerRe: What's the theory behind this: #ifdef __cplusplus extern "C" { Pin
«_Superman_»9-Jan-10 23:08
professional«_Superman_»9-Jan-10 23:08 
AnswerRe: What's the theory behind this: #ifdef __cplusplus extern "C" { Pin
CPallini9-Jan-10 23:28
mveCPallini9-Jan-10 23:28 
That typically encloses DLL's exported functions.
You should know, C Language and C++ one use different approach to function's name mangling (i.e. altering the name of the funtion in object -or library- files), more specifically, C++ includes in the mangled (or decorated) name info about the function argument types (this allows, function overloads, a C++ feature, not available in C language).
The mechanism allows the same header to be used by both the C and C++ compiler ( __cpluspls macro is defined only by the C++ one) and works this way:
The C compiler, ignores the extern "C" (__cplusplus is not defined) directive both when building the DLL and when including the DLL header inside an application.

The C++ compiler, according with the extern "C" (__cplusplus is defined) directive:
  • Produces a standard C DLL (i.e. the function use the C language mangling scheme) when building th DLL.
  • consider the library as a C DLL when the header is included in a application (you know C++ compiler is able to link with C libraries).


Hope it helps.
Smile | :)

If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.

This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke

[My articles]

Questionproblem with modless dialog box Pin
kir_MFC9-Jan-10 20:43
kir_MFC9-Jan-10 20:43 
AnswerRe: problem with modless dialog box Pin
«_Superman_»9-Jan-10 21:31
professional«_Superman_»9-Jan-10 21:31 
GeneralRe: problem with modless dialog box Pin
kir_MFC9-Jan-10 21:43
kir_MFC9-Jan-10 21:43 
GeneralRe: problem with modless dialog box Pin
«_Superman_»9-Jan-10 23:11
professional«_Superman_»9-Jan-10 23:11 
GeneralRe: problem with modless dialog box Pin
Iain Clarke, Warrior Programmer10-Jan-10 0:44
Iain Clarke, Warrior Programmer10-Jan-10 0:44 
AnswerRe: problem with modless dialog box Pin
kir_MFC9-Jan-10 21:55
kir_MFC9-Jan-10 21:55 
GeneralRe: problem with modless dialog box Pin
Richard MacCutchan10-Jan-10 22:24
mveRichard MacCutchan10-Jan-10 22:24 
AnswerRe: problem with modless dialog box Pin
billowqiu9-Jan-10 22:10
billowqiu9-Jan-10 22:10 
QuestionVC6++ ActiveX FlexGrid Pin
2buck569-Jan-10 20:40
2buck569-Jan-10 20:40 
AnswerRe: VC6++ ActiveX FlexGrid Pin
«_Superman_»9-Jan-10 21:36
professional«_Superman_»9-Jan-10 21:36 
GeneralRe: VC6++ ActiveX FlexGrid Pin
2buck5610-Jan-10 5:45
2buck5610-Jan-10 5:45 
GeneralRe: VC6++ ActiveX FlexGrid Pin
2buck5610-Jan-10 6:28
2buck5610-Jan-10 6:28 
QuestionLearning VS 2005 C++ - recommendation Pin
Denny1019-Jan-10 12:44
Denny1019-Jan-10 12:44 
AnswerRe: Learning VS 2005 C++ - recommendation Pin
Saurabh.Garg9-Jan-10 14:27
Saurabh.Garg9-Jan-10 14:27 
AnswerRe: Learning VS 2005 C++ - recommendation Pin
Rolf Kristensen9-Jan-10 23:47
Rolf Kristensen9-Jan-10 23:47 
GeneralRe: Learning VS 2005 C++ - recommendation Pin
LunaticFringe10-Jan-10 1:32
LunaticFringe10-Jan-10 1:32 
GeneralRe: Learning VS 2005 C++ - recommendation Pin
Rolf Kristensen10-Jan-10 1:40
Rolf Kristensen10-Jan-10 1:40 

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.