Domino Code Fragment

Code Name*
API Call to reference functions in Dynamic Link Libraries ?
Date*
04/28/2024
Source (or email address if you prefer)*
Rlatulippe@romac.com
IP address:.3.19.29.89
Description*
Calls a C function exported from Windows DLL to get WinDir
Type*
LotusScript
Categories*
(Misc)
Implementation:
Required Client:
Server:
Limitations:
Comments:
Files/Graphics attachments (if applicable): Code:
You can use C functions exported from Windows DLL files in your scripts. Before you make
use of a function you need to declare it. The following example shows how to use the Windows

API function called GetWindowsDirectory. This function determines the path of the Windows
directory on your system:


CONST MAX_DIR_SIZE = 144
DIM WinDir AS STRING*MAX_DIR_SIZE
DIM ActLen AS INTEGER
'The following line declares the Windows 'API function called GetWindowsDirectory:
Declare Function GetWindowsDirectory Lib "Kernel" (ByVal lpBuffer As String, ByVal nSize As
Integer) As Integer
'The next line makes use of this
'function. It puts the windows directory
'path into the string variable WinDir
'MAX_DIR_SIZE specifies the max length
'allowable for the path and ActLen
'stores the actual length
ActLen = GetWindowsDirectory ( WinDir, MAX_DIR_SIZE )
WinDir = mid$(WinDir,1,ActLen)
Print WinDir 'Prints Windows Directory