PreferredPacketDescription Property

PreferredPacketDescription Property

Gets an array of globally unique identifiers (GUIDs) that represents the preferred packet properties for the recognizer.

Declaration

[C++]


[propget] HRESULT get_PreferredPacketDescription (
    [out, retval] VARIANT* PreferredPacketDescription);

      

[Microsoft® Visual Basic® 6.0]


Public Property Get PreferredPacketDescription() As Variant

      

Property Value

VARIANT A BSTR array representing the GUIDs of the preferred packet properties for the IInkRecognizer. The GUIDs are represented in the following format (including curly braces).

{dfc71f44-354b-4ca1-93d7-7459410b6343}

This property is read-only.

For more information about the VARIANT and BSTR data types, see Using the Automation Library.

Return Value

HRESULT value Description
S_OK Success.
E_OUTOFMEMORY Cannot allocate the memory necessary to complete this operation.
E_POINTER The parameter is an invalid pointer.
E_INK_EXCEPTION An exception occurred inside the method.

Remarks

This property describes the contents of a packet and does not allow access to the data that the packet contains.

This property lists the packet properties that the recognizer uses to complete recognition. For all of the Microsoft recognizers, the PreferredPacketDescription property refers to the data describing (x,y) coordinates within a IInkStrokeDisp object. This data is represented by the X and Y fields of the packet property constants. A packet contains this point data as well as other data that is related to that stroke, such as the pressure of the pen that made the stroke, the angle of the pen, and so on. The Microsoft recognizers ignore pressure, tilt, and other packet properties.

Example

[Visual Basic 6.0]

This Visual Basic 6.0 example returns TRUE if the IInkRecognizer has the packet property GUID X (defined in the module InkConstants.bas in the Include directory of the Microsoft Windows® XP Tablet PC Edition Software Development Kit (SDK)) as one of its preferred packet descriptions.


Public Function PrefersX(ByVal theRecognizer As IInkRecognizer) As Boolean
    Dim theDescription() As Variant
    Dim myPacketDescription As Variant
    Dim i As Integer
    i = 0
    For Each _
        myPacketDescription In theRecognizer.PreferredPacketDescription
        ReDim Preserve theDescription(i)
        theDescription(i) = myPacketDescription
        i = i + 1
    Next
    Dim k As Integer
    For k = 0 To UBound(theDescription)
        If CStr(theDescription(k)) = X Then
            PrefersX = True
            Exit Function
        End If
    Next
    PrefersX = False
End Function

Applies To