cookie CmGetLastErrorText

Description

This function / method gets the error text of the last set error. The language of the text is the current set system language or English, if there's no language support for the system language. If the CM_GLET_DIALOG flag is set, the error text and some useful information are displayed in a message box (Windows / Windows CE only).

tmr_02

Triple Mode Redundancy-related information (TMR)

  • C, C++
  • C#
  • Python

Syntax

int CMAPIENTRY CmGetLastErrorText(CMULONG flCtrl, char *pszErrorText, CMUINT cbErrorText)

Parameter

flCtrl

nav_open CM_GLET_ERRORTEXT returns the related error text of the last set error code.

nav_open CM_GLET_DIALOG displays a message box with the related error text of the last set error code. This flag is only considered on Windows/Windows CE.

nav_open CM_GLET_DIALOG and CM_GLET_ERRORTEXT can be or'ed with the following flags:

nav_open CM_GLET_LOCAL_ENCODING uses local 8bit encoding.

nav_open CM_GLET_UTF8_ENCODING represents any character in the Unicode standard.

nav_open CM_GLET_WCHAR_ENCODING uses wide character encoding in ANSI/ISO C (UCS-2 on Windows/Windows CE and UTF-32 on Unix).

pszErrorText contains a pointer to a string to receive the error text.

cbErrorText contains the length of pszErrorText in bytes.

Return

This function returns the length of the error text or zero, if an error occurred. If pszErrorText does not contain enough memory, the number of needed bytes is returned.

Syntax

This method is overloaded, i.e. the same method name is used with different type of parameters or different set of parameters.

Method 1:

public string CmGetLastErrorText(CmGetLastErrorTextOption Ctrl)

This method returns the error text featuring various options.

Method 2:

public string CmGetLastErrorText()

This method returns the errort text.

Parameter

Ctrl

nav_open ErrorText returns the related error text of the last set error code.

nav_open Dialog displays a message box with the related error text of the last set error code. This flag is only considered on Windows/Windows CE.

nav_open Mask allows to mask bits for specifying the last error.

 

 

Syntax

import cmapi
 
cmapi.CodeMeter().CmGetLastErrorText() -> str
throws CodeMeterApiFailedException()

Return

This function returns a string containing the text encoded in ‘utf-8’ or throws a CodeMeterApiFailedException, if an error occurs.