Export (0) Print
Expand All
This topic has not yet been rated - Rate this topic

IRealTimeStylus::GetTabletFromTabletContextId method

Applies to: desktop apps only

Retrieves an IInkTablet Interface for a specified tablet context.

Syntax

HRESULT GetTabletFromTabletContextId(
  [in]           TABLET_CONTEXT_ID tcid,
  [out, retval]  IInkTablet **ppiTablet
);

Parameters

tcid [in]

Specifies the unique identifier for the tablet context.

ppiTablet [out, retval]

A pointer to the digitizer object specified by the tablet context identifier.

Return value

For a description of the return values, see RealTimeStylus Classes and Interfaces.

Remarks

A tablet context identifier is specific to a RealTimeStylus Class object. Two RealTimeStylus Class objects can have different context identifiers for the same tablet object. A tablet context identifier is only valid while a RealTimeStylus Class object is enabled. If a RealTimeStylus Class object is disabled and then re-enabled, the tablet context identifier for each tablet object may have a different value than when the RealTimeStylus Class object was first enabled.

This method can be called even if IRealTimeStylus::Enabled Property returns false as long as the IStylusPlugin::RealTimeStylusDisabled Method has not finished processing data in the queue. This method can be called until the last asynchronous plug-in receives IStylusPlugin::RealTimeStylusDisabled Method.

Examples

The following C++ example code uses the tablet context identifier to get a pointer to the IInkTablet Interface object.


TABLET_CONTEXT_ID* pTcids = NULL;
TABLET_CONTEXT_ID tcid = 0;
ULONG ulTcidCount = 0;
IInkTablet* pInkTablet = NULL;

if (SUCCEEDED(g_pRealTimeStylus->GetAllTabletContextIds(&ulTcidCount, &pTcids)))
{
    TRACE("Got the tablet context ID array.\n");

    // Loop through all the tablets on the system
    for (ULONG i = 0; i < ulTcidCount; i++)
    {
        // Get the tablet from the context ID
        if (SUCCEEDED(g_pRealTimeStylus->GetTabletFromTabletContextId(pTcids[i], &pInkTablet)))
        {
            // Display the name of the tablet in debug output
            BSTR bstrName;
            if (SUCCEEDED(pInkTablet->get_Name(&bstrName)))
            {
                TRACE("The name of tablet %d is %s.\n", i, bstrName);
            }
        }
    }

    // Get the context ID from the tablet
    if (SUCCEEDED(g_pRealTimeStylus->GetTabletContextIdFromTablet(pInkTablet, &tcid)))
    {
        TRACE("The context ID of the tablet is %d\n", tcid);
    }
}


Requirements

Minimum supported client

Windows XP Tablet PC Edition

Minimum supported server

None supported

Header

RTSCom.h (also requires RTSCom_i.c)

DLL

RTSCom.dll

See also

IRealTimeStylus
RealTimeStylus Class
IRealTimeStylus::GetTabletContextIdFromTablet Method
RealTimeStylus Class

 

 

Send comments about this topic to Microsoft

Build date: 3/6/2012

Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

ADD
Show:
© 2014 Microsoft. All rights reserved.