This function is used by HotDocs to enumerate the names and data types of all the available fields in the answer source application. GetFieldNameW is called repeatedly when a template developer attempts to map variables in a dialog to fields in the answer source, in order to retrieve the list of possible fields for mapping. HotDocs passes 0 in fieldNum the first time it calls GetFieldNameW (i.e., when it requests the first field name), and increments the number with each successive call. The implementation should set the field name and return the data type of the field.
This function was introduced with the release of HotDocs 2009 to support Unicode strings. Earlier versions of HotDocs will not call this function.
long GetFieldNameW ( LPCWSTR fieldName, long fieldNum )
Parameters | Description |
fieldName | The buffer for the field name. It can hold up to a maximum of 50 characters plus a NULL terminator. |
fieldNum | The number of the requested field name. |
Return the data type of the field (see HotDocs Data Types for a list of data types), or zero (0) to indicate there are no more fields to enumerate.
The following Visual C++ example uses GetFieldNameW:
long WINAPI GetFieldNameW( LPWSTR fieldName, long fieldNum )
{
long maxLen = 50;
if (fieldNum == 0)
{
wcscpy_s(fieldName, maxLen, L"First Name");
return 1;
}
else if (fieldNum == 1)
{
wcscpy_s(fieldName, maxLen, L"Lastګ Name");
return 1;
}
else
return 0;
}