GetMaxLength Method
Collapse the table of content
Expand the table of content

IEnumCERTVIEWCOLUMN::GetMaxLength method

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

pMaxLength [out]

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

Minimum supported client

None supported

Minimum supported server

Windows Server 2003 [desktop apps only]

Header

Certview.h (include Certsrv.h)

Library

Certidl.lib

DLL

Certadm.dll

IID

IID_IEnumCERTVIEWCOLUMN is defined as 9c735be2-57a5-11d1-9bdb-00c04fb683fa

See also

IEnumCERTVIEWCOLUMN
IEnumCERTVIEWCOLUMN::IsIndexed
IEnumCERTVIEWCOLUMN::Next
IEnumCERTVIEWCOLUMN::Reset
IEnumCERTVIEWCOLUMN::Skip

 

 

Show:
© 2016 Microsoft