Share via


PlugAndPlayID Property

PlugAndPlayID Property

Gets a string representation of the Plug and Play identifier of the IInkTablet object.

Declaration

[C++]

[C++]

[propget] HRESULT get_PlugAndPlayID (
    [out, retval] BSTR* PlugAndPlayID
);

      

[Microsoft® Visual Basic® 6.0]

[Visual Basic]

Public Property Get PlugAndPlayID() As String

      

Property Value

BSTR The string representation of the Plug and Play identifier of the IInkTablet object.

This property is read-only.

For more information about the BSTR data type, see Using the Automation Library.

Return Value

HRESULT value Description
S_OK Success.
E_POINTER The parameter is an invalid pointer.
E_OUTOFMEMORY Cannot not convert the Plug and Play identifier to a string.
E_INK_EXCEPTION An exception occurred inside the method.
E_FAIL An unspecified error occurred.

Remarks

The property value is based upon the HIDD_ATTRIBUTES.ProductID Leave Site element. The manufacturer of the tablet device is responsible for adding this string. The property value is empty if the tablet device does not have an identifier.

Example

[Visual Basic 6.0]

This Visual Basic 6.0 example reports on the properties in each IInkTablet object that is available in the InkTablets collection.

[Visual Basic]

Dim theInkCollector As InkCollector

Private Sub Command1_Click()
    Text1.Text = ReportOnEachTablet()
End Sub

Private Sub Form_Load()
    Set theInkCollector = New InkCollector
    theInkCollector.hWnd = Me.hWnd
    theInkCollector.Enabled = True
End Sub

Public Function ReportOnEachTablet() As String
    Dim theTablets As InkTablets
    Set theTablets = New InkTablets
    Dim theReport As String
    theReport = vbCrLf
    'Iterate over the tablets in the collection,
    'reporting on each one.
    Dim theTablet As IInkTablet
    For Each theTablet In theTablets
        theReport = theReport & "Tablet Name: " & theTablet.name & vbCrLf
        If theTablets.DefaultTablet.name = theTablet.name Then
            theReport = theReport & "(Default)" & vbCrLf
        End If
        theReport = theReport & "PlugAndPlayId: " & _
            theTablet.PlugAndPlayId & vbCrLf
        theReport = theReport & "HardwareCapabilities: " & _
            theTablet.HardwareCapabilities & vbCrLf
        If (theTablet.HardwareCapabilities And _
            THWC_CursorMustTouch) <> 0 Then
            theReport = theReport & "    CursorMustTouch" & vbCrLf
        End If
        If (theTablet.HardwareCapabilities And _
            THWC_CursorsHavePhysicalIds) <> 0 Then
            theReport = theReport & "    CursorsHavePhysicalIds" & vbCrLf
        End If
        If (theTablet.HardwareCapabilities And _
            THWC_HardProximity) <> 0 Then
            theReport = theReport & "    HardProximity" & vbCrLf
        End If
        If (theTablet.HardwareCapabilities And _
            THWC_Integrated) <> 0 Then
            theReport = theReport & "    Integrated" & vbCrLf
        End If
        On Error Resume Next
        theReport = theReport & "MaximumInputRectangle " & _
            theTablet.MaximumInputRectangle & vbCrLf

        'Report on each supported Packet Property.
        theReport = theReport & "IsPacketPropertySupported:" & vbCrLf
        theReport = theReport & GetProperty(theTablet, _
            AltitudeOrientation, _
            "AltitudeOrientation")
        theReport = theReport & GetProperty(theTablet, _
            AzimuthOrientation, _
            "AzimuthOrientation")
        theReport = theReport & GetProperty(theTablet, _
            ButtonPressure, "ButtonPressure")
        theReport = theReport & GetProperty(theTablet, _
            NormalPressure, "NormalPressure")
        theReport = theReport & GetProperty(theTablet, _
            PacketStatus, "PacketStatus")
        theReport = theReport & GetProperty(theTablet, _
            PitchRotation, "PitchRotation")
        theReport = theReport & GetProperty(theTablet, _
            RollRotation, "RollRotation")
        theReport = theReport & GetProperty(theTablet, _
            SerialNumber, "SerialNumber")
        theReport = theReport & GetProperty(theTablet, _
            TangentPressure, "TangentPressure")
        theReport = theReport & GetProperty(theTablet, _
            TimerTick, "TimerTick")
        theReport = theReport & GetProperty(theTablet, _
            TwistOrientation, "TwistOrientation")
        theReport = theReport & GetProperty(theTablet, X, "X")
        theReport = theReport & GetProperty(theTablet, _
            XTiltOrientation, "XTiltOrientation")
        theReport = theReport & GetProperty(theTablet, Y, "Y")
        theReport = theReport & GetProperty(theTablet, _
            YawRotation, "YawRotation")
        theReport = theReport & GetProperty(theTablet, _
            YTiltOrientation, "YTiltOrientation")
        theReport = theReport & GetProperty(theTablet, Z, "Z")
        theReport = theReport & vbCrLf
    Next

    ReportOnEachTablet = theReport
End Function

Public Function GetProperty( _
    ByVal theTablet As IInkTablet, _
    ByVal theGuid As String, _
    ByVal name As String) _
As String
    Dim theReport As String
    Dim theMin As Long
    Dim theMax As Long
    Dim theUnits As TabletPropertyMetricUnit
    Dim theResolution As Single

    ' If this particular property is supported,
    ' report the name and property metrics information.
    If theTablet.IsPacketPropertySupported(theGuid) Then
        theTablet.GetPropertyMetrics _
            theGuid, theMin, theMax, theUnits, theResolution
        theReport = "    " & name & vbCrLf & _
            "        Max: " & theMax & vbCrLf & _
            "        Min: " & theMin & vbCrLf & _
            "        Resolution: " & theResolution & _
            vbCrLf & _
            "        Units: " & theUnits & vbCrLf
    End If
    GetProperty = theReport
End Function

      

Applies To