2. Overview A dynamic-link library (DLL) is an executable file that acts as a shared library of functions. Dynamic linking provides a way for a process to call a function that is not part of its executable code. The executable code for the function is located in a DLL, which contains one or more functions that are compiled, linked, and stored separately from the processes that use them. DLLs also facilitate the sharing of data and resources. Multiple applications can simultaneously access the contents of a single copy of a DLL in memory.
3. Where you see DLLs DLLs (direct link libraries) are used throughout the Windows operating system. You can find many DLLs in the c:indowsystem32 directory on your computer
4. Why use DLLs? Research Question: Why is it advantageous to use DLLs in programming?
5. Why use DLLs? DLLs can be used for many purposes including: Sharing of resources Reduction of hard disk storage space requirements Easier updates of applications
6. Creation of a DLL DLLs can be created easily through Visual Basic. Create a new class library Create a public sub in the class library to be accessed by another application Save Click Build DLL Public Class Class1 Public Sub HelloWorld()MsgBox("Hello world") End SubEnd Class
7. Use a DLL DLLs can be used in Visual Basic by adding them as a resource to an application. Click Project Add Resource Browse for the DLL file you created Add code to your application to access the DLL code Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Dim t As New Class1t.HelloWorld()End Sub