Freigeben über


GetPreferredPacketDescription Function

GetPreferredPacketDescription Function

Returns a packet description that contains the packet properties the recognizer uses.

Syntax

[C++]

HRESULT WINAPI GetPreferredPacketDescription(
  HRECOGNIZER hrec,
  PACKET_DESCRIPTION *pPacketDescription
);

Parameters

hrec

[in] Handle to the recognizer context.

pPacketDescription

[out] Describes the content of the packets the recognizer uses. For more information, see the PACKET_DESCRIPTION structure.

To retrieve the packet description, initialize the packet description with zeroes and call the GetPreferredPacketDescription function. The function populates the property and button counts, which you use to allocate space for the pPacketProperties and pguidButtons members of the PACKET_DESCRIPTION structure. Call the function again to populate the rest of the packet description.

The pguidButtons member of the PACKET_DESCRIPTION structure may be zero when GetPreferredPacketDescription returns. This means the packets have no button data, so this member does not have any pguidButtons allocated. In this case, the calling function should leave the pointer NULL.

Return Value

HRESULT value Description
S_OK Success.
E_POINTER The parameter is an invalid pointer.

Remarks

Typically, recognizers use the (x, y) coordinate properties and ignore the others. If you save the ink to a file for recognition at a later time, use the preferred packet description to only save those properties that the recognizer uses.