IRealTimeStylus::AddStylusAsyncPlugin method (rtscom.h)
Adds an IStylusAsyncPlugin to the asynchronous plug-in collection at the specified index.
Syntax
HRESULT AddStylusAsyncPlugin(
[in] ULONG iIndex,
[in] IStylusAsyncPlugin *piPlugin
);
Parameters
[in] iIndex
Specifies the index of the plug-in in the asynchronous plug-in collection.
[in] piPlugin
The plug-in to add to.
Return value
For a description of the return values, see RealTimeStylus Classes and Interfaces.
Remarks
You cannot add asynchronous plug-ins if RealTimeStylus Class object has a child RealTimeStylus Class object.
Examples
The following C++ code example adds an instance of an IStylusAsyncPlugin to a RealTimeStylus object. The example code uses the QueryInterface method on a GestureRecognizer plug-in, g_pGestureHandler
, to get the IStylusAsyncPlugin interface, then calls IRealTimeStylus::AddStylusAsyncPlugin Method.
HRESULT CCOMRTSDlg::InitGestureHandler()
{
// Create an IGestureHandler object
HRESULT hr = CoCreateInstance(CLSID_GestureHandler, NULL, CLSCTX_INPROC, IID_IGestureHandler, (VOID **)&g_pGestureHandler);
if (SUCCEEDED(hr))
{
// Get a pointer to the IStylusAsyncPlugin interface
IStylusAsyncPlugin* pAsyncPlugin;
hr = g_pGestureHandler->QueryInterface(IID_IStylusAsyncPlugin, reinterpret_cast<void**>(&pAsyncPlugin));
if (SUCCEEDED(hr))
{
// Get the current count of plugins so we can
// add this one to the end of the collection
ULONG nAsyncPluginCount;
hr = g_pRealTimeStylus->GetStylusAsyncPluginCount(&nAsyncPluginCount);
if (SUCCEEDED(hr))
{
// Add the plugin to the StylusAsyncPlugin collection
hr = g_pRealTimeStylus->AddStylusAsyncPlugin(nAsyncPluginCount, pAsyncPlugin);
if (SUCCEEDED(hr))
{
// Pass the Gesture Handler a pointer to the
// status window so it can update the status
hr = g_pGestureHandler->SetStatusWindow(&m_staticGestureStatus);
}
}
}
}
return hr;
}
Requirements
Requirement | Value |
---|---|
Minimum supported client | Windows XP Tablet PC Edition [desktop apps only] |
Minimum supported server | None supported |
Target Platform | Windows |
Header | rtscom.h |
DLL | RTSCom.dll |
See also
RealTimeStylus Class