Here are a couple of snippets out of the DomReg.nsf in the sandbox. I have used this code successfully for years.
I am about to move the Notes server to another OS and would like to make my LotusScript and Java calls indifferent to the underlying OS.
Are there LotusScript native functions to do the same thing that these two functions in nNotes.dll?
’ NAMELookup and OSMemFree are used in EnsureUserInNAB.
’ NOTE: if you are running this app on a platform other than
’ Windows 32 Intel, then you will have to change the name of the
’ dll in these two declarations. Look in your Notes executable
’ directory for *notes.dll to see what it is called, or for the proper
’ form of shared library on your platform.
Declare Sub NAMELookup Lib “nnotes.dll” _
(Byval serverName As Integer, _
Byval flags As Integer, _
Byval numNameSpaces As Integer, _
Byval nameSpaces As String, _
Byval numNames As Integer, _
Byval names As String, _
Byval numItems As Integer, _
Byval items As String, _
rethBuffer As Long _
)
Declare Sub OSMemFree Lib “nnotes.dll” (Byval hBuffer As Long)
Sub EnsureUserInNAB(Byval fullname As String)
Dim hBuf As Long
Call NAMELookup(0, 0, 1, "$Users", 1, fullname, 1, "HTTPPassword", hBuf)
Call OSMemFree(hBuf)
Call NAMELookup(0, 0, 1, "$ServerAccess", 1, fullname, 1, "ListName", hBuf)
Call OSMemFree(hBuf)
End Sub