Click here to Skip to main content
15,917,005 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralPost Message. Pin
John Uhlenbrock2-Sep-01 14:06
John Uhlenbrock2-Sep-01 14:06 
GeneralRe: Post Message. Pin
Michael Dunn2-Sep-01 15:08
sitebuilderMichael Dunn2-Sep-01 15:08 
GeneralRe: Post Message. Pin
Matt Gullett2-Sep-01 16:00
Matt Gullett2-Sep-01 16:00 
GeneralRe: Post Message. Pin
Matt Gullett2-Sep-01 17:58
Matt Gullett2-Sep-01 17:58 
GeneralSimple DLL, Simple DLL, Simple DLL , P L E A S E !!! Pin
2-Sep-01 9:05
suss2-Sep-01 9:05 
GeneralRe: Simple DLL, Simple DLL, Simple DLL , P L E A S E !!! Pin
Mukkie2-Sep-01 10:44
Mukkie2-Sep-01 10:44 
GeneralThank you ! Pin
3-Sep-01 0:15
suss3-Sep-01 0:15 
GeneralRe: Thank you ! Pin
Mukkie3-Sep-01 12:35
Mukkie3-Sep-01 12:35 
Do not use LoadLibrary for this case.

Create DLL project. In this project, create header file. In this header write:

In dialog class declaration (header file) put:
#ifdef DLL_BUILDING
#define DllExportImport __declspec(dllexport)
#else
#define DllExportImport __declspec(dllimport)
#endif

class DLLExportImport CMyDialog : public CDialog
...
In project settings of dll add DLL_BUILDING define
That's all for now for dll project. Compile and forget.


Let's go back to exe project.Include the header, You have created in the dll.
The difference, is that when building dll, DLL_BUILDING macro will be defined, so DLLExplortImport will be changed by preprocessor into __declspec(dllexport). When building exe project, You won't have DLL_BUILDING defined, so __declspec(dllimport) will be used.
In link tab (project settings) of exe project, add path (relative or full) to .lib file generated during build of dll.


For more information, see msdn and search for dllexport or dllimport.

uki?
GeneralRe: Thank you ! Pin
3-Sep-01 21:52
suss3-Sep-01 21:52 
GeneralRe: Simple DLL, Simple DLL, Simple DLL , P L E A S E !!! Pin
Jim A. Johnson2-Sep-01 13:21
Jim A. Johnson2-Sep-01 13:21 
Generalabout COleServerItem Pin
Maer7272-Sep-01 5:31
Maer7272-Sep-01 5:31 
Generalabout COleClientItem Pin
Maer7272-Sep-01 5:29
Maer7272-Sep-01 5:29 
GeneralBefore The System Pin
The_Server2-Sep-01 2:32
The_Server2-Sep-01 2:32 
GeneralRe: Before The System Pin
Anders Molin2-Sep-01 2:48
professionalAnders Molin2-Sep-01 2:48 
GeneralRe: Before The System Pin
The_Server2-Sep-01 10:50
The_Server2-Sep-01 10:50 
GeneralRe: Before The System Pin
2-Sep-01 3:10
suss2-Sep-01 3:10 
GeneralRe: Before The System Pin
The_Server2-Sep-01 10:52
The_Server2-Sep-01 10:52 
GeneralRe: Before The System Pin
Mukkie2-Sep-01 10:48
Mukkie2-Sep-01 10:48 
GeneralRe: Before The System Pin
| mProject |2-Oct-01 0:54
| mProject |2-Oct-01 0:54 
GeneralRe: Before The System Pin
Manish Pansiniya28-Oct-04 6:32
Manish Pansiniya28-Oct-04 6:32 
GeneralRe: Before The System Pin
Manish Pansiniya28-Oct-04 6:33
Manish Pansiniya28-Oct-04 6:33 
QuestionASAP: convertion ? Pin
The_Server1-Sep-01 23:40
The_Server1-Sep-01 23:40 
AnswerRe: ASAP: convertion ? Pin
Michael Dunn2-Sep-01 6:38
sitebuilderMichael Dunn2-Sep-01 6:38 
General: _CRTDBG_MAP_ALLOC, stdlib.h, crtdbg.h и malloc.h Pin
Dmitriy Reznitskiy1-Sep-01 23:15
Dmitriy Reznitskiy1-Sep-01 23:15 
GeneralRe: : _CRTDBG_MAP_ALLOC, stdlib.h, crtdbg.h и malloc.h Pin
Tomasz Sowinski3-Sep-01 0:50
Tomasz Sowinski3-Sep-01 0:50 

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.