INtime SDK Help
CfgParGetComment

Read the comment for a parameter.

DWORD CfgParGetComment(
CFGFILE cFile,
    LPCSTR  szSection,
    LPCSTR  szPar,
    LPSTR   pDest,
    int*    pLen
);

Parameters

cFile
(in) File handle retrieved by previous CfgFileOpen with argument CFG_SECTION as type.
szSection
(in) Name of section in which the parameter is searched.
szPar
(in) Name of parameter.
pDest
(out) Pointer to buffer to receive the string. The buffer must be at least *pLen characters long. The terminating zero is stored in the buffer, so there must be space for that.
pLen
(in, out) Pointer to a variable that is set to the size of the buffer before the call. On successful return, the variable now contains the length of the value (including terminating zero).

Return values

ECFG_OK for success or an error code on failure.

Remarks

Read the comment for a section/parameter. If there is no comment for the given parameter, the buffer is set to an empty string. In case of ECFG_LIMIT the pLen contains the size of buffer needed, nothing is copied to the buffer.

Errors

ECFG_BADCFGFILE
File handle out of range or invalid
ECFG_LIMIT
Size of buffer too small.
ECFG_NOTFOUND
Section name not found
ECFG_NOTFOUND2
Parameter name not found
ECFG_WRONGFILETYPE
Wrong file type
See Also