Click here to Skip to main content
15,897,273 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: what is "hooks or hooking" in the mfc Pin
James R. Twine17-Apr-07 2:44
James R. Twine17-Apr-07 2:44 
QuestionHow to set menuitem ID in owner drawn menu? Pin
Atul2317-Apr-07 2:02
Atul2317-Apr-07 2:02 
AnswerRe: How to set menuitem ID in owner drawn menu? Pin
sthotakura17-Apr-07 7:27
sthotakura17-Apr-07 7:27 
Questionhow to link dll Pin
viduran17-Apr-07 1:47
viduran17-Apr-07 1:47 
AnswerRe: how to link dll Pin
Paresh Chitte17-Apr-07 1:56
Paresh Chitte17-Apr-07 1:56 
AnswerRe: how to link dll Pin
Nibu babu thomas17-Apr-07 2:04
Nibu babu thomas17-Apr-07 2:04 
AnswerRe: how to link dll Pin
toxcct17-Apr-07 2:16
toxcct17-Apr-07 2:16 
AnswerRe: how to link dll Pin
Programm3r17-Apr-07 2:21
Programm3r17-Apr-07 2:21 
Hi,

An easy way that I normally follow is to do the following:

In your header file you will find the following(more or less):
#ifdef PROJECT_EXPORTS
	#define PROJECT_API __declspec(dllexport)
#else
	#define PROJECT_API __declspec(dllimport)
#endif


Create a function prototype in header file:
PROJECT_API int myFunc(int a, int b);


Export your function in a .def file.

LIBRARY PROJECT
DESCRIPTION "Export Some Symbols."
EXPORTS
DllMain @1
myFunc @2

In your calling application, include the header file of your dll program and copy the .lib and .dll files (found in the debug directory) to the calling applications directory.
Link your calling application with the .lib file. (Project Properties -> Linker -> Input -> Additional Dependencies)
And call the function.
myfunc(2, 4);


Hope this helps Smile | :)
Regards,


The only programmers that are better than C programmers are those who code in 1's and 0's..... Smile | :)

Smile | :) Programm3r

My Blog: ^_^

GeneralRe: how to link dll Pin
toxcct21-Apr-07 10:35
toxcct21-Apr-07 10:35 
QuestionRe: how to link dll Pin
viduran18-Apr-07 0:09
viduran18-Apr-07 0:09 
Questionfocus on main application window... Pin
Sunil P V17-Apr-07 1:25
Sunil P V17-Apr-07 1:25 
AnswerRe: focus on main application window... Pin
Paresh Chitte17-Apr-07 1:34
Paresh Chitte17-Apr-07 1:34 
AnswerRe: focus on main application window... [modified] Pin
Nibu babu thomas17-Apr-07 1:35
Nibu babu thomas17-Apr-07 1:35 
GeneralRe: focus on main application window... Pin
Sunil P V17-Apr-07 1:41
Sunil P V17-Apr-07 1:41 
GeneralRe: focus on main application window... Pin
Nibu babu thomas17-Apr-07 1:43
Nibu babu thomas17-Apr-07 1:43 
GeneralRe: focus on main application window... Pin
Michael Dunn17-Apr-07 18:04
sitebuilderMichael Dunn17-Apr-07 18:04 
GeneralRe: focus on main application window... Pin
Nibu babu thomas17-Apr-07 18:24
Nibu babu thomas17-Apr-07 18:24 
QuestionRegarding runtime error Pin
Nikhil Trivedi17-Apr-07 1:16
Nikhil Trivedi17-Apr-07 1:16 
AnswerRe: Regarding runtime error Pin
kakan17-Apr-07 2:05
professionalkakan17-Apr-07 2:05 
QuestionDialog in C/C++ [modified] Pin
Programm3r17-Apr-07 1:06
Programm3r17-Apr-07 1:06 
AnswerRe: Dialog in C/C++ Pin
syampj17-Apr-07 1:22
syampj17-Apr-07 1:22 
QuestionRe: Dialog in C/C++ Pin
Programm3r17-Apr-07 2:02
Programm3r17-Apr-07 2:02 
AnswerRe: Dialog in C/C++ Pin
Arman S.17-Apr-07 2:54
Arman S.17-Apr-07 2:54 
GeneralRe: Dialog in C/C++ Pin
Programm3r17-Apr-07 7:26
Programm3r17-Apr-07 7:26 
AnswerRe: Dialog in C/C++ Pin
David Crow17-Apr-07 4:26
David Crow17-Apr-07 4:26 

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.