|
-
Oct 20th, 2002, 05:00 PM
#1
Thread Starter
Addicted Member
Linking to a dll
I made a dll project... and I made an exe project But I'm afraid I'm not sure how to link them. I went through another program I got a while back that does this but I still can't figure out how.
[edit]BTW, I use MS VC++ 6[/edit]
Last edited by Xerpher; Oct 20th, 2002 at 05:16 PM.
-
Oct 21st, 2002, 03:24 AM
#2
Addicted Member
What do you want to do with them?
From a project you can load a DLL through LoadLibrary and then access an exported function using GetProcAddress. Have a look in the MSDN libraries for linking to DLLs etc.
Hope it helps.
HD
-
Oct 21st, 2002, 06:40 AM
#3
Monday Morning Lunatic
I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
-- Linus Torvalds
-
Oct 21st, 2002, 10:47 AM
#4
Thread Starter
Addicted Member
-
Oct 21st, 2002, 12:01 PM
#5
Monday Morning Lunatic
You need to use the .lib file created when you linked the DLL in conjunction with the header file. That way it can link the functions implictly. Without them, you need LoadLibrary and GetProcAddress.
I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
-- Linus Torvalds
-
Oct 22nd, 2002, 06:47 AM
#6
This means you need to take the lib file that is created and list it in the linker input section of the project settings.
All the buzzt
 CornedBee
"Writing specifications is like writing a novel. Writing code is like writing poetry."
- Anonymous, published by Raymond Chen
Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.
-
Oct 22nd, 2002, 10:54 AM
#7
Thread Starter
Addicted Member
After its compiled, Do I still need to include the .lib file? or does it look for .dll when its compiled?
-
Oct 22nd, 2002, 11:23 AM
#8
Huh?
You don't need to distribute the lib along with your app if that's what you want to know - all your app needs is included in the exe.
All the buzzt
 CornedBee
"Writing specifications is like writing a novel. Writing code is like writing poetry."
- Anonymous, published by Raymond Chen
Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.
-
Oct 22nd, 2002, 11:43 AM
#9
Monday Morning Lunatic
The .lib has information on which DLL actually contains the code, so no, you don't need the .lib afterwards.
I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
-- Linus Torvalds
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|