IRealTimeStylus::AddStylusAsyncPlugin 方法 (rtscom.h)

IStylusAsyncPlugin 添加到位于指定索引处的异步插件集合。

语法

HRESULT AddStylusAsyncPlugin(
  [in] ULONG              iIndex,
  [in] IStylusAsyncPlugin *piPlugin
);

参数

[in] iIndex

指定异步插件集合中插件的索引。

[in] piPlugin

要添加到的插件。

返回值

有关返回值的说明,请参阅 RealTimeStylus 类和接口

注解

如果 RealTimeStylus 类 对象具有子 RealTimeStylus 类 对象,则无法添加异步插件。

示例

下面的 C++ 代码示例将 IStylusAsyncPlugin 的实例添加到 RealTimeStylus 对象。 示例代码使用 GestureRecognizer 插件 上的 g_pGestureHandlerQueryInterface 方法获取 IStylusAsyncPlugin 接口,然后调用 IRealTimeStylus::AddStylusAsyncPlugin 方法

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;
}

要求

要求
最低受支持的客户端 Windows XP Tablet PC Edition [仅限桌面应用]
最低受支持的服务器 无受支持的版本
目标平台 Windows
标头 rtscom.h
DLL RTSCom.dll

另请参阅

IRealTimeStylus

IStylusAsyncPlugin

IStylusSyncPlugin

RealTimeStylus 类