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 attributes of the WinCC OA version if you specify the version as project name (for example, "3.6").
0 is returned if the function was executed successfully. An error code is returned in case of errors. 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 inside the corresponding WinCC OA entries of the Windows registry, e.g.:
-
InstallationDate
-
InstallationDir
-
InstallationUser
-
InstallationVersion
-
...
Also the config entries of WinCC OA can be queried (see Possible Config Entries in WinCC OA).
EXAMPLE
Following example shows how to get the InstallationDate entry of 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
Assignment
COM