本文整理汇总了C++中NBUnitDevicePtrList::remove方法的典型用法代码示例。如果您正苦于以下问题:C++ NBUnitDevicePtrList::remove方法的具体用法?C++ NBUnitDevicePtrList::remove怎么用?C++ NBUnitDevicePtrList::remove使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类NBUnitDevicePtrList
的用法示例。
在下文中一共展示了NBUnitDevicePtrList::remove方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: OnAddMirror
void CMainFrame::OnAddMirror(UINT wNotifyCode, int wID, HWND hwndCtl)
{
CNBDevice *pDevice = m_viewTreeList.GetSelectedDevice();
if(!pDevice)
return;
if(!pDevice->GetCommandAbility(wID))
return;
CNBLogicalDevice *pLogicalDevice = dynamic_cast<CNBLogicalDevice *>(pDevice);
if(!pLogicalDevice || pLogicalDevice->IsGroup())
return;
NBUnitDevicePtrList listUnitDevices = GetOperatableSingleDevices();
// remove self
listUnitDevices.remove((*pLogicalDevice)[0]);
CNBSelectDeviceDlg dlgSelectDevice(
IDD_DEVICE_LIST,
IDS_MIRROR_ADD_DLG_CAPTION,
IDS_MIRROR_ADD_DLG_MESSAGE,
listUnitDevices,
1,
CheckCapacityForMirror,
pLogicalDevice);
if(dlgSelectDevice.DoModal() != IDOK)
return;
CNBUnitDevice *pUnitDeviceAdd = dlgSelectDevice.GetSelectedDevice();
CNBUnitDevice *pUnitDevice = pUnitDevice = (*pLogicalDevice)[0];
// Bind & Synchronize
NDASCOMM_CONNECTION_INFO ConnectionInfo[2];
pUnitDevice->InitConnectionInfo(&ConnectionInfo[0], TRUE);
pUnitDeviceAdd->InitConnectionInfo(&ConnectionInfo[1], TRUE);
AutoCursor l_auto_cursor(IDC_WAIT);
UINT32 BindResult = NdasOpBind(
2,
ConnectionInfo,
NMT_SAFE_RAID1,
0);
l_auto_cursor.Release();
if(2 != BindResult)
{
CString strMsg;
DWORD dwLastError = ::GetLastError();
switch(dwLastError)
{
case NDASCOMM_ERROR_RW_USER_EXIST:
case NDASOP_ERROR_ALREADY_USED:
case NDASOP_ERROR_DEVICE_FAIL:
case NDASOP_ERROR_NOT_SINGLE_DISK:
case NDASOP_ERROR_DEVICE_UNSUPPORTED:
strMsg.FormatMessage(IDS_BIND_FAIL_AT_SINGLE_NDAS_FMT,
(BindResult == 0) ? pUnitDevice->GetName() : pUnitDeviceAdd->GetName());
break;
default:
strMsg.LoadString(IDS_BIND_FAIL);
break;
}
ShowErrorMessageBox(strMsg);
return;
}
pUnitDevice->HixChangeNotify(pGetNdasHostGuid());
pUnitDeviceAdd->HixChangeNotify(pGetNdasHostGuid());
/*
CRecoverDlg dlgRecover(FALSE, IDS_LOGDEV_TYPE_DISK_RAID1, IDS_RECOVERDLG_TASK_ADD_MIRROR);
ATLASSERT(FALSE);
// dlgRecover.SetMemberDevice(pUnitDeviceAdd);
dlgRecover.DoModal();
*/
OnRefreshStatus(NULL, NULL, NULL);
}