Click here to Skip to main content
15,896,912 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: river crossing priests and devils in c program Pin
jeron11-Feb-18 3:19
jeron11-Feb-18 3:19 
QuestionRe: river crossing priests and devils in c program Pin
David Crow1-Feb-18 3:47
David Crow1-Feb-18 3:47 
QuestionC++ - Static templated method inside a class Pin
phil.o31-Jan-18 12:00
professionalphil.o31-Jan-18 12:00 
AnswerRe: C++ - Static templated method inside a class Pin
Richard MacCutchan31-Jan-18 12:13
mveRichard MacCutchan31-Jan-18 12:13 
GeneralRe: C++ - Static templated method inside a class Pin
phil.o31-Jan-18 13:28
professionalphil.o31-Jan-18 13:28 
GeneralRe: C++ - Static templated method inside a class Pin
Richard MacCutchan31-Jan-18 21:41
mveRichard MacCutchan31-Jan-18 21:41 
GeneralRe: C++ - Static templated method inside a class Pin
phil.o31-Jan-18 14:07
professionalphil.o31-Jan-18 14:07 
GeneralRe: C++ - Static templated method inside a class Pin
CPallini31-Jan-18 21:20
mveCPallini31-Jan-18 21:20 
GeneralRe: C++ - Static templated method inside a class Pin
Richard MacCutchan31-Jan-18 21:48
mveRichard MacCutchan31-Jan-18 21:48 
GeneralRe: C++ - Static templated method inside a class Pin
phil.o1-Feb-18 3:20
professionalphil.o1-Feb-18 3:20 
GeneralRe: C++ - Static templated method inside a class Pin
Richard MacCutchan1-Feb-18 4:08
mveRichard MacCutchan1-Feb-18 4:08 
QuestionExplorer Pin
Fedrer31-Jan-18 0:12
Fedrer31-Jan-18 0:12 
AnswerRe: Explorer Pin
Richard MacCutchan31-Jan-18 0:49
mveRichard MacCutchan31-Jan-18 0:49 
AnswerRe: Explorer Pin
Jochen Arndt31-Jan-18 1:22
professionalJochen Arndt31-Jan-18 1:22 
AnswerRe: Explorer Pin
Randor 31-Jan-18 5:26
professional Randor 31-Jan-18 5:26 
QuestionSize of a window Pin
Anthony Appleyard29-Jan-18 5:05
Anthony Appleyard29-Jan-18 5:05 
AnswerRe: Size of a window Pin
OriginalGriff29-Jan-18 5:07
mveOriginalGriff29-Jan-18 5:07 
AnswerRe: Size of a window Pin
Victor Nijegorodov29-Jan-18 10:49
Victor Nijegorodov29-Jan-18 10:49 
GeneralRe: Size of a window Pin
Anthony Appleyard31-Jan-18 5:56
Anthony Appleyard31-Jan-18 5:56 
GeneralRe: Size of a window Pin
Richard MacCutchan31-Jan-18 6:05
mveRichard MacCutchan31-Jan-18 6:05 
QuestionClass as a DLL Pin
ForNow24-Jan-18 5:37
ForNow24-Jan-18 5:37 
AnswerRe: Class as a DLL Pin
Richard MacCutchan24-Jan-18 6:51
mveRichard MacCutchan24-Jan-18 6:51 
ForNow wrote:
I don’t specify __declspec(dllimport)
No because that declaration will be in the header file. You should take a look at Creating and Using a Dynamic Link Library (C++)[^] for more information. Basically the project that creates the dll needs __declspec(dllexport) and every application the wants to use it needs __declspec(dllimport). This is usually controlled by a #define in the header that goes with the dll. If you create a DLL project in Visual Studio and select the "Export Symbols" checkbox, you get the following in the header:
C++
// The following ifdef block is the standard way of creating macros which make exporting 
// from a DLL simpler. All files within this DLL are compiled with the WIN32PROJECT2_EXPORTS
// symbol defined on the command line. This symbol should not be defined on any project
// that uses this DLL. This way any other project whose source files include this file see 
// WIN32PROJECT2_API functions as being imported from a DLL, whereas this DLL sees symbols
// defined with this macro as being exported.
#ifdef WIN32PROJECT2_EXPORTS
#define WIN32PROJECT2_API __declspec(dllexport)
#else
#define WIN32PROJECT2_API __declspec(dllimport)
#endif

// This class is exported from the Win32Project2.dll
class WIN32PROJECT2_API CWin32Project2 {
public:
	CWin32Project2(void);
	// TODO: add your methods here.
};

extern WIN32PROJECT2_API int nWin32Project2;

WIN32PROJECT2_API int fnWin32Project2(void);

GeneralRe: Class as a DLL Pin
ForNow24-Jan-18 7:28
ForNow24-Jan-18 7:28 
GeneralRe: Class as a DLL Pin
Richard MacCutchan24-Jan-18 7:51
mveRichard MacCutchan24-Jan-18 7:51 
GeneralRe: Class as a DLL Pin
ForNow24-Jan-18 8:09
ForNow24-Jan-18 8:09 

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.