<< Click to Display Table of Contents >> VpeGetControlAsString |
Returns the value of the specified control as string.
int VpeGetControlAsString(
VpeHandle hControl,
LPSTR value,
UINT *size
)
VpeHandle hControl
Control Handle
LPSTR value
pointer to a buffer that receives the string. This parameter can be NULL, if the data is not required, in such case no data is copied
UINT *size
pointer to a variable that specifies the size, in bytes, of the buffer pointed to by the value parameter. When the function returns, this variable contains the number of bytes copied to value - including the size of the terminating null character.
If value is NULL, and size is non-NULL, the function returns True and stores the size of the data, in bytes, in the variable pointed to by size. This lets an application determine the best way to allocate a buffer for the value's data.
Returns:
Value |
Description |
True |
value retrieved successfully |
False |
value could not be retrieved (for example out of memory) |
Remarks:
If the control was created from a template and it has an associated field, you should not use this property. It is - from the programmer's view and source code logic - more efficient to use instead the field's methods and properties in order to access the control's value.
The corresponding property of the field is VpeGetFieldAsString.
Example:
UINT uSize;
char szRecipientCompany[256];
hControl = VpeFormFieldControl(hDoc, 1, 1, -9, VFREE, "Hello World!");
uSize = sizeof(szRecipientCompany);
VpeGetControlAsString(hControl, szRecipientCompany, &uSize);
"Interactive Documents" in the Programmer's Manual.