IEnumCERTVIEWCOLUMN::GetMaxLength method (certview.h)

The GetMaxLength method retrieves the maximum allowable length, in bytes, for the column data.

If the column data's type is PROPTYPE_STRING, divide the number of bytes by sizeof(WCHAR) to determine the maximum number of Unicode characters.

Syntax

HRESULT GetMaxLength(
  [out] LONG *pMaxLength
);

Parameters

[out] pMaxLength

A pointer to a value of LONG type that contains the maximum allowable length for the column data. This function will fail if pMaxLength is NULL.

Return value

C++

If the method succeeds, the method returns S_OK and the pMaxLength is set to the maximum allowable length for the column data.

If the method fails, it returns an HRESULT value that indicates the error. For a list of common error codes, see Common HRESULT Values.

VB

The return value is the maximum allowable length, in bytes, for the column data.

Remarks

This method is used to determine the maximum allowable data length for the column currently being referenced by the column-enumeration sequence.

If the column-enumeration sequence is not referencing a valid column, GetMaxLength will fail. Use one of the following methods to navigate through the enumeration:

To determine whether the column data is indexed, call the IEnumCERTVIEWCOLUMN::IsIndexed method.

Examples

// pEnumCol is previously instantiated IEnumCERTVIEWCOLUMN object
HRESULT  hr;
LONG     nLength;

// determine database length
hr = pEnumCol->GetMaxLength(&nLength);
if (S_OK == hr)
    printf("max length is %d\n", nLength);

Requirements

Requirement Value
Minimum supported client None supported
Minimum supported server Windows Server 2003 [desktop apps only]
Target Platform Windows
Header certview.h (include Certsrv.h)
Library Certidl.lib
DLL Certadm.dll

See also

IEnumCERTVIEWCOLUMN

IEnumCERTVIEWCOLUMN::IsIndexed

IEnumCERTVIEWCOLUMN::Next

IEnumCERTVIEWCOLUMN::Reset

IEnumCERTVIEWCOLUMN::Skip