Domino 9 und frühere Versionen > ND8: Administration & Userprobleme

LN Version incl. Fixpack ermitteln

<< < (2/2)

eknori:
Ich weiss, daß es mit der API geht ( LS2CAPI), finde es aber momentan nicht. Ich such mal weiter.
Eine andere Möglichkeit ist, die nstrings.dll auszulesen. Dort ist die Version gespeichert, die im Client angezeigt wird.

eknori:
OK, here we go

Declaration section:

--- Code: ---'** Error code masks
Const ERR_MASK = &H3fff
Const PKG_MASK = &H3f00
Const ERRNUM_MASK = &H00ff

Declare Function OSLoadString Lib "nnotes.dll" (Byval hModule As Long, Byval stringCode As Integer, _
Byval retBuffer As String, Byval bufferLength As Integer) As Integer
--- Ende Code ---


--- Code: ---Function GetAPIError (errorCode As Integer) As String
'** this function translates Notes API error codes into their
'** corresponding error strings
Dim errorString As String*256
Dim returnErrorString As String
Dim resultStringLength As Long
Dim errorCodeTranslated As Integer

'** mask off the top 2 bits of the errorCode that was returned; this is
'** what the ERR macro in the API does
errorCodeTranslated = (errorCode And ERR_MASK)

'** get the error code translation using the OSLoadString API function
resultStringLength = OSLoadString(0, errorCodeTranslated, errorString, Len(errorString) - 1)

'** strip off the null-termination on the string before you return it
If (Instr(errorString, Chr(0)) > 0) Then
returnErrorString = Left$(errorString, Instr(errorString, Chr(0)) - 1)
Else
returnErrorString = errorString
End If

GetAPIError = returnErrorString

End Function
--- Ende Code ---

und ein Aufruf mit


--- Code: ---Sub Click(Source As Button)
Msgbox  GetAPIError (1)
End Sub
--- Ende Code ---

gibt die die aktuelle NotesVersion incl. FP zurück. Funktioniert auch auf LINUX und MAC, wenn man OSLoadString entsprechend anpasst.

koehlerbv:
Sehr cool! Danke, Ulrich.

Bernhard

Navigation

[0] Themen-Index

[*] Vorherige Sete

Zur normalen Ansicht wechseln