Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Why would I want to use a DLL

Status
Not open for further replies.

Guru2B

Programmer
May 24, 2000
77
GB
Hi!

I was wondering if there's an easy answer to this one.

Why would I want to use a dll file in my apps and how would I create one? I have been getting on quite nicely without making my own, but somehow I feel as though I am missing out on something.

Thanks,
Guru2B
 
Dll files are cool. Basically with a dll file you can just make an API call to the dll. This includes all windows dll files. Basically a dll file is a bunch of prewritten code that is used by software. Ever want to play a sound file...

#If Win32 Then
Declare Function sndPlaySound Lib "winmm" Alias "sndPlaySoundA" _
(ByVal lpSound As String, ByVal flag As Long) As Long
#ElseIf Win16 Then
Declare Function sndPlaySound Lib "MMSYSTEM" _
(ByVal lpszSoundName As String, ByVal uFlags As Integer) As Integer
#End If

dim iReturn as integer
Private sub Form_Load()
iReturn = sndPlaySound("C:\winnt\sound.wav", 0)
end sub


The above form would play a sound file using the winmm.dll or the mmsystem.dll if in win16.. It uses the built in function sndPlaySoundA. There are zillions of uses for dlls (The most juicy stuff of programming).. If you wanted to create your own dll.. Lets say you have 2 programs that share alot of the same funcions + procedures.. Instead having the functions and procedures defined in each programs source, you can put these functions + procedures into a dll file. If your company makes alot of software, or does alot of updates, or you want to make the exe smaller, or it to use less memory, there are alot of reasons to make a dll file.
 
Well thank you for the info. Is there anything special that has to be done with the installer? I use the packaging and deployment wizard. Does that handle the registration of the dlls automatically?

Guru2B
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top