GetFirstForm2

Top  Previous  Next

The GetFirstForm2 method starts an enumeration of forms, retrieving the name and the properties of the first form in the enumeration.

HRESULT GetFirstForm2(

[out] BSTR*  p_pwsFormName,

[out] BSTR*  p_pwsFormDescription,

[out] FLOAT* p_pfWidth,

[out] FLOAT* p_pfHeight,

[out] BOOL*  p_pbVisible,

[in]  BSTR   p_wsProfileName,

[in]  BOOL   p_bPublicProfile

);

 

Parameters:

p_pwsFormName

[out]pointer to a pointer to a BSTR 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 BSTR 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

p_wsProfileName

[in] pointer to a BSTR containing the profile to modify. If this parameter is an empty string, the current active profile is used.

p_bPublicProfile

[in] Flag if the profile is a public or a private profile.

 

Return values:

S_OK on success or COM error code

NV_NOT_INITIALIZED - Initialize 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);

}