GetNextForm2

Top  Previous  Next

The GetNextForm2 continues the custom forms enumeration started with GetFirstForm2.

HRESULT GetNextForm2(

[out] BSTR*  p_pwsFormName,

[out] BSTR*  p_pwsFormDescription,

[out] FLOAT* p_pfWidth,

[out] FLOAT* p_pfHeight,

[out] BOOL*  p_pbVisible

);

 

Parameters:

p_pwsFormName

[out]pointer to a pointer to a null terminated Unicode string that will contain the name of the custom form. The allocated memory must be freed by the caller with SysFreeString

p_pwsFormDescription

[out]pointer to a pointer to a null terminated Unicode string that will contain the description of the custom form. The allocated memory must be freed by the caller with SysFreeString

p_pfWidth

[out] will contain the width of the form in millimeters

p_pfHeight

[out] will contain the height of the form in millimeters

p_pbVisible

[out] will be TRUE if this form is visible in the printing preferences dialog

 

Return values:

S_OK on success or COM error code

NV_NOT_INITIALIZED - Initialize was not called

NV_ENUM_NOT_INIT - GetFirstForm2 was not called

NV_NO_MORE_FORMS - no more forms to enumerate

 

Remarks:

GetFirstForm2 along with GetNextForm2 are used to enumerate all custom forms like in the code sample below:

hr = GetFirstForm2(&pName, ...)

while (SUCCEEDED(hr) && hr != NV_NO_MORE_FORMS) {

// do something with pName, and the other parameters

// ...

SysFreeString(pName);

// get next form if it exists

hr = GetNextForm2(&pName);

}