|
-
Jun 26th, 2001, 09:52 PM
#1
Thread Starter
Fanatic Member
Few questions about DLL's
These are probably easy, but since I have no idea:
1. What exactly is a DLL?
2. What are DLL's used for?
3. How do you make one?
Alcohol & calculus don't mix.
Never drink & derive.
-
Jun 27th, 2001, 04:01 AM
#2
Frenzied Member
A DLL is a file that contains functions. For example all the api functions are inside dll's. Dll's are used for more organised code and for smaller exes.
To make one go to new project and choose win32 dynamic link library.
-
Jul 7th, 2001, 07:04 PM
#3
Thread Starter
Fanatic Member
So if I had an exe and a dll, I can have my functions in the dll and when I change something I can just send a user the dll?
Alcohol & calculus don't mix.
Never drink & derive.
-
Jul 7th, 2001, 07:26 PM
#4
Frenzied Member
Well, it depends of the changes, but generaly you can do that.
-
Jul 14th, 2001, 01:54 PM
#5
Thread Starter
Fanatic Member
Ok, one more question, how do you call the functions inside the DLL?
Alcohol & calculus don't mix.
Never drink & derive.
-
Jul 15th, 2001, 03:49 PM
#6
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
-
Jul 15th, 2001, 05:10 PM
#7
Frenzied Member
You can also use Load-TIme Dynamic Linking:
Using Load-Time Dynamic Linking
After you have created a DLL, you can use it in an application. The following file, LOADTIME.C, is the source code for a simple console application that uses the myPuts function exported from MYPUTS.DLL.
// File: LOADTIME.C.
// A simple program that uses myPuts from MYPUTS.DLL.
#include <windows.h>
VOID myPuts(LPTSTR); // a function from a DLL
VOID main(VOID)
{
myPuts("message printed using the DLL function\n");
}
Because LOADTIME.C calls the DLL function explicitly, the module for the application must be linked with the import library MYPUTS.LIB. For more information about building DLLs, see the documentation included with your development tools.
-
Jul 15th, 2001, 06:02 PM
#8
Thread Starter
Fanatic Member
Parksie, two things:
1. When I try to compile this code, I get this link error: "LINK : fatal error LNK1104: cannot open file 'mylib.lib'". Isn't that what I am compiling? Also, when I take mylib.lib out of the project settings i get unresolved external link errors.
2. In loadlib.cpp, where you have the function pointers and finding the function, do I have to do that for every function I write?
Alcohol & calculus don't mix.
Never drink & derive.
-
Jul 15th, 2001, 06:21 PM
#9
Monday Morning Lunatic
1. MyLib.lib is generated when you compile the DLL project, not the test program
2. Yes - however this would normally happen when your program was initialised so you only need to use the function call.
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
-
Jul 15th, 2001, 08:15 PM
#10
Thread Starter
Fanatic Member
Ok, thanks a lot for the help and the project
Alcohol & calculus don't mix.
Never drink & derive.
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
|