GetNextForm

Top  Previous  Next

The GetNextForm continues the custom forms enumeration started with GetFirstForm.

HRESULT GetNextForm(

[out] LPWSTR* p_pwsFormName,

[out] LPWSTR* 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 CoTaskMemFree

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 CoTaskMemFree

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 - GetFirstForm was not called

NV_NO_MORE_FORMS - no more forms to enumerate

 

Remarks:

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

hr = GetFirstForm(&pName, ...)

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

// do something with pName, and the other parameters

// ...

CoTaskMemFree(pName);

// get next form if it exists

hr = GetNextForm(&pName);

}