本文整理汇总了C++中atl::CComPtr::ExecuteCommand方法的典型用法代码示例。如果您正苦于以下问题:C++ CComPtr::ExecuteCommand方法的具体用法?C++ CComPtr::ExecuteCommand怎么用?C++ CComPtr::ExecuteCommand使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类atl::CComPtr
的用法示例。
在下文中一共展示了CComPtr::ExecuteCommand方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: openDoor
/**
* Opens the Door! :)
*
* Parameters:
* >szDoor
* Path to lock device for the door.
*
* Returns:
* N/A.
*/
void perco_exchange::openDoor(_In_ STLADD string_unique_ptr_t&& szDoor)
{
ATL::CComPtr<PERCo_S20_SDK::IExchangeMain> percoXchg;
if (SUCCEEDED(percoXchg.CoCreateInstance(__uuidof(PERCo_S20_SDK::CoExchangeMain))))
{
if (SUCCEEDED(percoXchg->SetConnect(PERCO_HOST, PERCO_PORT, PERCO_LOGIN, PERCO_PWD)))
{
BSTR szDBVersion;
BSTR szSDKVersion;
if (!percoXchg->CheckVersion(&szDBVersion, &szSDKVersion))
{
ATL::CComPtr<IXMLDOMDocument2> request = getSendCommandsRequest(std::move(szDoor));
AtlTrace2(ATL::atlTraceGeneral, 0, "Sending the 'sendcommands' request.\r\n");
if (request && SUCCEEDED(percoXchg->ExecuteCommand(request)))
{
AtlTrace2(ATL::atlTraceGeneral, 0, "PERCo has responded to the 'sendcommands' request.\r\n");
}
}
percoXchg->DisConnect();
}
}
else
{
AtlTrace2(ATL::atlTraceCOM, 0, "'PERCo_S20_SDK::IExchangeMain' ain't registered.\r\n");
}
}