COM - getProjAttr()
Returns an attribute for a WinCC OA project from the config file or from the registry.
Synopsis
HRESULT GetProjAttr([in] BSTR sProjName, [in] BSTR sProjAttr, [out] BSTR* sProjValue, [out,retval] int* iError);
(ProjAdminAuto)
HRESULT GetProjAttr([in] BSTR sProjName, [in] BSTR sProjAttr, [out] VARIANT* sProjValue, [out,retval] int* iError);
Parameter
Parameter | Description |
---|---|
sProjName | The project name. |
sProjAttr | The attribute to be queried. |
sProjValue | The value of the attribute. |
iError | Error status. |
Description
This function can also be used to query version attributes of the WinCC OA version if you specify the version as the project name (e.g. "3.20").
0 is returned if the function was executed successfully. In the event of an error, an error code is returned. The code corresponds to an error description in the message catalog pv2admin.cat.
The possible attributes that can be used for getProjAttr can be found in the corresponding WinCC OAentries in the Windows registry, e.g:
- InstallationDate
- InstallationDir
- InstallationUser
- InstallationVersion
- ...
The config entries of WinCC OA can also be queried - see Possible Config Entries in WinCC OA.
Example
The following example shows how to retrieve the InstallationDate entry in the Windows registry.
Public Sub getProjAttr()
Dim iErr As Integer
If Len(msActProjName) Then
iErr = moProjAdmin.getProjAttr(msActProjName, "InstallationDate", msInstDate)
If iErr <> 0 Then
MsgBox "Kann nicht auf das InstallationDate zugreifen!", _
vbOKOnly + vbCritical, _
"getProjAttr"
End If
End If
End Sub