Retrieves the name of the current process's module.
Public Declare Function PKI_ModuleName Lib "diCrPKI.dll"
(ByVal strName As String, ByVal nStrLen As Long, ByVal nOptions As Long) As Long
nRet = PKI_ModuleName(strName, nStrLen, 0)
String to receive the name of the module.Long specifying the maximum length of the string to be copied.Long option flags: not used in this release. Specify zero.
long _stdcall PKI_ModuleName(char *szOutput, long nOutputLen, long reserved);
Long: If successful, the return value is the number of characters in the output string;
otherwise it returns a negative error code.
Dim nLen As Long
Dim strModuleName As String
nLen = PKI_ModuleName("", 0, 0)
If nLen > 0 Then
strModuleName = String(nLen, " ")
nLen = PKI_ModuleName(strModuleName, nLen, 0)
strModuleName = Left(strModuleName, nLen)
Debug.Print "PKI_ModuleName returns " & nLen & " [" & strModuleName & "]"
Else
Debug.Print "Error " & nLen & " with PKI_ModuleName"
End If
On our W2000 system, this produces the output:
PKI_ModuleName returns 29 [C:\WINNT\system32\diCrPKI.dll]