Click here to Skip to main content
15,883,705 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Large Menu Items Pin
cryptoknight1719-May-10 9:38
cryptoknight1719-May-10 9:38 
GeneralRe: Large Menu Items Pin
Code-o-mat19-May-10 11:28
Code-o-mat19-May-10 11:28 
GeneralRe: Large Menu Items Pin
cryptoknight1719-May-10 12:22
cryptoknight1719-May-10 12:22 
QuestionSave/Restore "state" of document in CHtmlView Pin
nobaq18-May-10 5:52
nobaq18-May-10 5:52 
QuestionClass Custom Control Pin
AbhiHcl18-May-10 2:33
AbhiHcl18-May-10 2:33 
AnswerRe: Class Custom Control PinPopular
Iain Clarke, Warrior Programmer18-May-10 2:42
Iain Clarke, Warrior Programmer18-May-10 2:42 
GeneralRe: Class Custom Control Pin
AbhiHcl18-May-10 23:57
AbhiHcl18-May-10 23:57 
GeneralRe: Class Custom Control Pin
Iain Clarke, Warrior Programmer19-May-10 1:58
Iain Clarke, Warrior Programmer19-May-10 1:58 
OK, so you can make a DLL.... Check.
And this is in MFC... Check.

So, there's only a few simple things to do:

1/ Make a header somewhere that both the dll code, and the later exe code can read. (I have a workspace include directory, normally).

Near the top, have code like this:
#ifdef	IAINDLL
#define	IAINEXPORT __declspec(dllexport)
#else
#define IAINEXPORT __declspec(dllimport)
#endif


When you write your CButton inheriting class, start like this:
class IAINEXPORT  CIainButton : public CButton
{

};


In your project settings, make sure to add the following symbol to the defines: IAINDLL. That way, when code in the DLL sees the header file, it says "oh, this will be exported!", and when code elsewhere sees the header file, it says "aha, I will link to these class functions".

If you don't know how to write a custom CButton class, then Button Controls[^] is full of examples for you to follow.

Good luck,

Iain.
I have now moved to Sweden for love (awwww).

QuestionVisual Studio Addin for source code editor tooltip [modified] Pin
lclarsen18-May-10 1:58
lclarsen18-May-10 1:58 
QuestionMemory leak In Excel range pointer Pin
trioum18-May-10 0:53
trioum18-May-10 0:53 
AnswerRe: Memory leak In Excel range pointer Pin
Stephen Hewitt18-May-10 14:06
Stephen Hewitt18-May-10 14:06 
GeneralRe: Memory leak In Excel range pointer Pin
trioum18-May-10 22:30
trioum18-May-10 22:30 
QuestionService access file on network folder Pin
baerten18-May-10 0:39
baerten18-May-10 0:39 
AnswerRe: Service access file on network folder Pin
Garth J Lancaster18-May-10 0:52
professionalGarth J Lancaster18-May-10 0:52 
AnswerRe: Service access file on network folder Pin
Covean18-May-10 0:52
Covean18-May-10 0:52 
AnswerRe: Service access file on network folder Pin
baerten18-May-10 2:39
baerten18-May-10 2:39 
GeneralRe: Service access file on network folder Pin
sashoalm18-May-10 7:45
sashoalm18-May-10 7:45 
Questionmake a timer Pin
hasani200717-May-10 23:05
hasani200717-May-10 23:05 
AnswerRe: make a timer Pin
Rajesh R Subramanian17-May-10 23:26
professionalRajesh R Subramanian17-May-10 23:26 
JokeRe: make a timer Pin
CPallini17-May-10 23:45
mveCPallini17-May-10 23:45 
AnswerRe: make a timer Pin
Maximilien18-May-10 0:30
Maximilien18-May-10 0:30 
GeneralRe: make a timer Pin
Stephen Hewitt18-May-10 0:35
Stephen Hewitt18-May-10 0:35 
AnswerRe: make a timer Pin
KarstenK18-May-10 1:26
mveKarstenK18-May-10 1:26 
AnswerRe: Here is your count down timer hasani2007 Pin
Software_Developer18-May-10 7:31
Software_Developer18-May-10 7:31 
GeneralRe: Here is your count down timer hasani2007 Pin
Stephen Hewitt18-May-10 14:04
Stephen Hewitt18-May-10 14:04 

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.