Dynamic link library can be understood by looking at how it differs from a header file(look at the following figure):
HEADER FILE-->Collection of functions which are not compiled
DLL------>Collection of functions which are already compiled, thats
Header file+Source code---->COMPILER---->obj file
obj file+dll file---->LINKER----->exe file
I know to create DLL file only in VC++6.0.
1.Open vc++6.0
2.File->new
3.Select MFC application wizard(dll) option and select create after giving the name for project..
4.Click Finish button from wizard
5.Type the code in the TheApp class as follows(a function add(int a, int b):
extern "C" __declspec(dllexport)double firstadd(double a,double b)
{
return a+b;
}
6. Press F5 key, your dll file will be ready
to use the dll file:
1.Create a new project as before and choose MFC application wizard(exe)
2.in any header file type :
extern "C" __declspec(dllimport)double add(double a, double b);
3.Now u can call the add function in usual way anywhere in ur program.
4.press F5 to run...
The steps may not be clear if u havent worked with VC++ before..
But still i hope the concept of dll is clear..........