LangId

ITcEventView

This property sets and returns the language that is used for displaying the viewer, event messages and source names.
You may either supply only the primary language id (e.g. ENG = 9; GER = 7) or a compete LCID (e.g. ENG = 1033; GER = 1031). The TcEventViewer will then decide what the parameter is. Setting the language id will have two effects: on the one hand it will switch its internal string table to the specified language, on the other hand it will delegate the supplied value to the TcEventFormatter. It is important to understand that the supplied values will only be delegated to the formatter. If you specify Lang id as 7 (GER) the default formatters will lookup the string '7'. If in your resource file german is defined as '1031', the ressource will not be found - and vice versa.

 

Property get

HRESULT get_LangId([out, retval] long *pVal);

Parameters

pVal

[out, retval] pointer to a long variable that receives the actual selected language id

Return Values

S_OK

Function was successfully called

E_POINTER

pVal was no valid pointer

Property let

HRESULT put_LangId([in] long newVal);

Parameters

newVal

[in] The language Id of the requested language. The requested language should be tagged by *LCIDs. The next table shows a sample for some language ids. In the configuration of the event formatter the language are tagged by the same language id

LCID

Description

1031

German

1033

US English

1034

Spanish - Spain

1036

French

 

Return Values

S_OK

Function was successfully called

Visual Basic sample code

Option Explicit
' add the Beckhoff TcEvent View Library to the components
' place a TcEventView on the form, and assign the name TcEventView1

Private Sub Form_Load()
  ' prints the old language id
  Debug.Print TcEventView1.LangId
 ' sets the language id to English
 TcEventView1.LangId = 1033
End Sub

Remarks

If a new language is assigned all displayed events are retrieved again in the new selected languages