Thread: DLLs
View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
AA2e72E[_2_] AA2e72E[_2_] is offline
external usenet poster
 
Posts: 93
Default DLLs

It is a vertical learning curve to start with but it gets very easy after the first few successful calls

Windows API (application programming interface) calls use code in DLLs. These are Win32 Dlls. These are always available to you provided that you include the functions in the Declarations section of your code. E.g

Private Declare Function GetSystemDirectory Lib "kernel32" Alias "GetSystemDirectoryA" (ByVal lpBuffer As String, ByVal nSize As Long) As Lon

This will return the folder where Windows is installed

There are also ActiveX DLLs. You can use these with 'early' binding i.e you need to add a reference to it or you can use 'late' binding: you do not need to add a reference
E.g the File System Object is an ActiveX DLL. (SCRRUN.DLL); it is shown as Microsoft Scripting Runtime when you are in the IDE and click Tools | References. You would use it as follows
(early
DIM FSO as New Scripting.FileSystemObjec

FSO = New Scripting.FileSystemObjec
(late
Dim FSO
Set FSO = CreateObject("Scripting.FileSystemObject"

FSO is ow an instance of the file system object and will expose all its methods and properties

I am unable to recommend any specific book. Search for examples of Windows APIs on the Internet. File System Objectis usually covered in any book dealing with scripting

Good Luck.