Click here to Skip to main content
15,899,026 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: [Win32 C] how save HICON to a icon file? Pin
Programm3r5-Mar-07 21:53
Programm3r5-Mar-07 21:53 
AnswerRe: [Win32 C] how save HICON to a icon file? Pin
prasad_som5-Mar-07 21:53
prasad_som5-Mar-07 21:53 
GeneralRe: [Win32 C] how save HICON to a icon file? Pin
HOW WHAT5-Mar-07 22:14
HOW WHAT5-Mar-07 22:14 
GeneralRe: [Win32 C] how save HICON to a icon file? Pin
prasad_som5-Mar-07 22:25
prasad_som5-Mar-07 22:25 
QuestionHow to change "Caption" of Menu Item Dynamcally? Pin
cshivaprasad5-Mar-07 21:39
cshivaprasad5-Mar-07 21:39 
AnswerRe: How to change "Caption" of Menu Item Dynamcally? Pin
prasad_som5-Mar-07 22:07
prasad_som5-Mar-07 22:07 
QuestionDLL Header file content Pin
Programm3r5-Mar-07 21:34
Programm3r5-Mar-07 21:34 
AnswerRe: DLL Header file content Pin
Cedric Moonen5-Mar-07 21:53
Cedric Moonen5-Mar-07 21:53 
#ifdef STATIC_LIBRARY

This is probably a user defined macro (I don't think this is a standard macro). The user can specify if the library should be a static or a dynamic library.
If it is a static library, then you don't need to add specific keyword before your functions in order to be exported (so, DLL_IMPORT_EXPORT will simply be empty).

In the other, if it is a dynamic library, you need to:
1) export your functions if the project is the dll project (in that case, the macro DLL_SOURCE_CODE will be specified by the user)
2) import your functions if the project is using the dll (in that case, the macro DLL_SOURCE_CODE is not defined).

This is only used on the WIN32 platform (thus the #ifdef WIN32).

That summarize the first part, meaning:


Programm3r wrote:
#ifdef STATIC_LIBRARY
#define DLL_IMPORT_EXPORT
#else
#ifdef WIN32
#ifdef DLL_SOURCE_CODE
#define DLL_IMPORT_EXPORT __declspec(dllexport) __stdcall
#else
#define DLL_IMPORT_EXPORT __declspec(dllimport) __stdcall
#endif
#endif
#endif


For the second part (with the NoMangle), you check if the code is C++ specific or C. If it is C, this language use a different linking mechanism (name mangling) and you then need to specify that you are using the 'C' linking scheme (extern "C").

Hope that helps. If you still don't understand, ask a more precise question (which part you don't understand).




Cédric Moonen
Software developer

Charting control [v1.1]

GeneralRe: DLL Header file content Pin
Programm3r5-Mar-07 21:58
Programm3r5-Mar-07 21:58 
QuestionMedia Pin
Try5-Mar-07 21:33
Try5-Mar-07 21:33 
AnswerRe: Media Pin
kakan5-Mar-07 21:39
professionalkakan5-Mar-07 21:39 
GeneralRe: Media Pin
Try5-Mar-07 21:43
Try5-Mar-07 21:43 
GeneralRe: Media Pin
kakan5-Mar-07 22:09
professionalkakan5-Mar-07 22:09 
GeneralRe: Media [modified] Pin
Try5-Mar-07 22:39
Try5-Mar-07 22:39 
GeneralRe: Media Pin
kakan5-Mar-07 23:42
professionalkakan5-Mar-07 23:42 
GeneralRe: Media Pin
Try6-Mar-07 1:41
Try6-Mar-07 1:41 
GeneralRe: Media Pin
kakan6-Mar-07 1:47
professionalkakan6-Mar-07 1:47 
QuestionAbout files??? Pin
siddharthsan5-Mar-07 21:29
siddharthsan5-Mar-07 21:29 
QuestionMinimize application to system tray Pin
eli150219795-Mar-07 20:31
eli150219795-Mar-07 20:31 
AnswerRe: Minimize application to system tray Pin
Xing Chen5-Mar-07 21:00
Xing Chen5-Mar-07 21:00 
QuestionCopy folder to pendrive Pin
Vjys5-Mar-07 20:21
Vjys5-Mar-07 20:21 
AnswerRe: Copy folder to pendrive Pin
Rajesh R Subramanian5-Mar-07 21:02
professionalRajesh R Subramanian5-Mar-07 21:02 
AnswerRe: Copy folder to pendrive Pin
kakan5-Mar-07 21:07
professionalkakan5-Mar-07 21:07 
GeneralRe: Copy folder to pendrive Pin
Vjys5-Mar-07 21:42
Vjys5-Mar-07 21:42 
GeneralRe: Copy folder to pendrive Pin
kakan5-Mar-07 21:59
professionalkakan5-Mar-07 21:59 

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.