当前位置: 首页>>代码示例>>C++>>正文


C++ CString::LoadString方法代码示例

本文整理汇总了C++中wtl::CString::LoadString方法的典型用法代码示例。如果您正苦于以下问题:C++ CString::LoadString方法的具体用法?C++ CString::LoadString怎么用?C++ CString::LoadString使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在wtl::CString的用法示例。


在下文中一共展示了CString::LoadString方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: GetStatusString

WTL::CString CNBUnitDevice::GetStatusString()
{
	WTL::CString strText;

	DWORD status = GetStatus();

	if(NDASBIND_UNIT_DEVICE_STATUS_DISCONNECTED & status)
	{
		strText.LoadString(IDS_STATUS_NOT_CONNECTED);
	}
	else if(NDASBIND_UNIT_DEVICE_STATUS_MOUNTED & status)
	{
		strText.LoadString(IDS_STATUS_IN_USE);
	}
	else if(NDASBIND_UNIT_DEVICE_STATUS_NO_WRITE_KEY & status)
	{
		strText.LoadString(IDS_STATUS_READ_ONLY);
	}
	else
	{
		strText.LoadString(IDS_STATUS_FINE);
	}

	return strText;
}
开发者ID:yzx65,项目名称:ndas4windows,代码行数:25,代码来源:nbdev.cpp

示例2: CheckCapacityForMirror

BOOL CALLBACK CheckCapacityForMirror(CNBUnitDevice *pUnitDevice, HWND hWnd, LPVOID lpContext)
{
	if(!lpContext)
		return TRUE;

	if(!pUnitDevice)
		return FALSE;

	CNBLogicalDevice *pLogicalDevice = (CNBLogicalDevice *)lpContext;

	for(UINT32 i = 0; i < pLogicalDevice->DevicesTotal(); i++)
	{
		if ((*pLogicalDevice)[i] && 
			(*pLogicalDevice)[i]->GetCapacityInByte() > pUnitDevice->GetCapacityInByte())
		{
			WTL::CString strMsg;
			strMsg.LoadString( IDS_SELECTMIRDLG_SMALLER_DISK );
			WTL::CString strTitle;
			strTitle.LoadString(IDS_APPLICATION);

			MessageBox(
				hWnd,
				strMsg,
				strTitle, 
				MB_OK | MB_ICONWARNING
				);

			return FALSE;
		}
	}

	return TRUE;
}
开发者ID:yzx65,项目名称:ndas4windows,代码行数:33,代码来源:nbmainfrm.cpp

示例3: Start

void CRecoverDlg::Start()
{
	WTL::CString strBtnFace;

	//
	// Launch working thread
	//
	m_btnOK.EnableWindow(FALSE);

	strBtnFace.LoadString( IDS_RECOVER_BTN_CANCEL );
	m_btnCancel.SetWindowText( strBtnFace );
	m_btnCancel.EnableWindow(FALSE);

	m_bRunning = TRUE;

	HANDLE hThread;
	hThread = CreateThread(
		NULL,
		0,
		ThreadRecover,
		this,
		NULL, // run immediately
		NULL);

	if(!hThread)
	{
		WTL::CString strMsg = _T("");
		ShowErrorMessageBox(strMsg);

		strBtnFace.LoadString( IDS_RECOVER_BTN_CLOSE );
		m_btnCancel.SetWindowText( strBtnFace );
		m_bRunning = FALSE;
		m_bFinished = TRUE;
	}
}
开发者ID:yzx65,项目名称:ndas4windows,代码行数:35,代码来源:nbrecoverdlgs.cpp

示例4: dlgRecover

BOOL CRAID4DiskUIHandler::OnRecover(CDiskObjectPtr obj) const
{
	ATLASSERT( dynamic_cast<CRAID4DiskObject*>(obj.get()) != NULL );
	
	CRAID4DiskObjectPtr raid4Disk = 
		boost::dynamic_pointer_cast<CRAID4DiskObject>(obj);

	if(!raid4Disk->IsDirty())
	{
		WTL::CString strMsg;
		strMsg.LoadString(IDS_WARNING_NOT_NEED_RECOVER );
		WTL::CString strTitle;
		strTitle.LoadString(IDS_APPLICATION);
		MessageBox( 
			::GetFocus(),
			strMsg,
			strTitle,
			MB_OK | MB_ICONERROR
			);
		return TRUE;
	}

	std::list<CDiskObjectPtr>::iterator it;
	CUnitDiskObjectPtr pUnitDisk;

	it = raid4Disk->begin();
	INT32 iDirty;
	for(iDirty = raid4Disk->GetDirtyDisk(); iDirty > 0; iDirty--)
		it++;

	pUnitDisk = boost::dynamic_pointer_cast<CUnitDiskObject>(*it);

	CRecoverDlg dlgRecover(FALSE, IDS_LOGDEV_TYPE_DISK_RAID4, IDS_RECOVERDLG_TASK_RECOVER);

	dlgRecover.SetMemberDevice(pUnitDisk);
	dlgRecover.DoModal();

	CNdasHIXChangeNotify HixChangeNotify(pGetNdasHostGuid());
	BOOL bResults = HixChangeNotify.Initialize();
	if(bResults)
	{
		NDAS_UNITDEVICE_ID unitDeviceId;

		for(it = raid4Disk->begin(); it != raid4Disk->end(); ++it)
		{
			pUnitDisk = boost::dynamic_pointer_cast<CUnitDiskObject>(*it);
			CopyMemory(unitDeviceId.DeviceId.Node,
				pUnitDisk->GetLocation()->GetUnitDiskLocation()->MACAddr,
				sizeof(unitDeviceId.DeviceId.Node));
			unitDeviceId.UnitNo = 
				pUnitDisk->GetLocation()->GetUnitDiskLocation()->UnitNumber;
			HixChangeNotify.Notify(unitDeviceId);
		}
	}

	return TRUE;
}
开发者ID:yzx65,项目名称:ndas4windows,代码行数:57,代码来源:nbuihandler.cpp

示例5: CallBackRecover

BOOL CRecoverDlg::CallBackRecover(
	DWORD dwStatus,
	UINT32 Total,
	UINT32 Current)

{
	WTL::CString strBtnFace;

	switch(dwStatus)
	{
	case NDAS_RECOVER_STATUS_INITIALIZE:
		// activate stop button
		m_nBytesPerBit = Current;
		m_timeBegin = ::time( NULL );
		m_progBar.OnSetRange32(0, 0, Total);
		m_progBar.OnSetPos(0, 0, NULL);
		m_btnCancel.EnableWindow(TRUE);
		SetPhaseText(IDS_RECOVERDLG_PHASE_SYNC);
		break;
	case NDAS_RECOVER_STATUS_RUNNING:
		RefreshProgBar(Total, Current);
		// refresh time remaining, progress
		break;
	case NDAS_RECOVER_STATUS_FINALIZE:
		//		m_bFinished = TRUE;
		break;
	case NDAS_RECOVER_STATUS_FAILED:
		m_bRunning = FALSE;
		m_bFinished = FALSE;

		m_btnOK.EnableWindow(TRUE);
		strBtnFace.LoadString( IDS_RECOVER_BTN_CLOSE );
		m_btnCancel.SetWindowText(strBtnFace);
		m_btnCancel.EnableWindow(TRUE);
		SetPhaseText(IDS_RECOVERDLG_PHASE_READY);
		break;
	case NDAS_RECOVER_STATUS_COMPLETE:
		m_bRunning = FALSE;
		m_bFinished = TRUE;

		m_btnOK.EnableWindow(FALSE);
		strBtnFace.LoadString( IDS_RECOVER_BTN_CLOSE );
		m_btnCancel.SetWindowText(strBtnFace);

		SetPhaseText(IDS_RECOVERDLG_PHASE_DONE);
		break;
	}

	if(m_bStopRequest)
	{
		m_bStopRequest = FALSE;
		return FALSE;
	}

	return TRUE;
}
开发者ID:yzx65,项目名称:ndas4windows,代码行数:56,代码来源:nbrecoverdlgs.cpp

示例6: GetTypeString

WTL::CString CNBUnitDevice::GetTypeString()
{
	// AING_TO_DO : Set proper text
	WTL::CString strText;
	switch(GetType())
	{
	case NMT_INVALID:
	case NMT_SINGLE: strText.LoadString(IDS_LOGDEV_TYPE_SINGLE_DISK); break;
	case NMT_MIRROR: strText.LoadString(IDS_LOGDEV_TYPE_SINGLE_DISK); break;
	case NMT_SAFE_RAID1: strText.LoadString(IDS_LOGDEV_TYPE_SINGLE_DISK); break;
	case NMT_AGGREGATE: strText.LoadString(IDS_LOGDEV_TYPE_SINGLE_DISK); break;
	case NMT_RAID0: strText.LoadString(IDS_LOGDEV_TYPE_SINGLE_DISK); break;
	case NMT_RAID1: strText.LoadString(IDS_LOGDEV_TYPE_SINGLE_DISK); break;
	case NMT_RAID4: strText.LoadString(IDS_LOGDEV_TYPE_SINGLE_DISK); break;
	case NMT_AOD: strText.LoadString(IDS_LOGDEV_TYPE_SINGLE_DISK); break;
	case NMT_VDVD: strText.LoadString(IDS_LOGDEV_TYPE_SINGLE_DISK); break;
	case NMT_CDROM: strText.LoadString(IDS_LOGDEV_TYPE_SINGLE_DISK); break;
	case NMT_OPMEM: strText.LoadString(IDS_LOGDEV_TYPE_SINGLE_DISK); break;
	case NMT_FLASH: strText.LoadString(IDS_LOGDEV_TYPE_SINGLE_DISK); break;
	default:
		break;
	}

	return strText;
}
开发者ID:yzx65,项目名称:ndas4windows,代码行数:25,代码来源:nbdev.cpp

示例7: OnUnBind

void CMainFrame::OnUnBind(UINT /*wNotifyCode*/, int /*wID*/, HWND /*hwndCtl*/)
{
	ENTER_CRITICAL_SECTION(&m_csThreadRefreshStatus);

	CTreeItem itemSelected = m_view.GetSelectedItem();
	if ( itemSelected.IsNull() )
	{
		LEAVE_CRITICAL_SECTION(&m_csThreadRefreshStatus);
		return;
	}

	CDiskObjectPtr obj, parent;
	obj = m_mapObject[m_view.GetItemData(itemSelected)];
	
	// Find topmost group composite of bind
	parent = obj->GetParent();
	while ( !parent->IsRoot() )
	{
		obj = parent;
		parent = obj->GetParent();
	}

	//
	// Check whether any disk is being accessed by other program/computer
	//
	if ( !obj->CanAccessExclusive() )
	{
		LEAVE_CRITICAL_SECTION(&m_csThreadRefreshStatus);
		WTL::CString strMsg;
		strMsg.LoadString(IDS_FAIL_TO_ACCESS_EXCLUSIVELY);
		WTL::CString strTitle;
		strTitle.LoadString(IDS_APPLICATION);
		MessageBox( 
			strMsg,
			strTitle,
			MB_OK | MB_ICONWARNING
			);
		return;
	}

	// Unbind disks
	CUnBindDlg dlgUnbind;

	dlgUnbind.SetDiskToUnbind(obj);
	if ( dlgUnbind.DoModal() == IDOK )
	{
		// AING : Cause dlgBind use ndasop.lib to bind disks, 
		// you can't ensure each disk information is stable after bind process.
		OnRefreshStatus(NULL, NULL, NULL);
	}

	LEAVE_CRITICAL_SECTION(&m_csThreadRefreshStatus);
}
开发者ID:yzx65,项目名称:ndas4windows,代码行数:53,代码来源:nbmainfrm.cpp

示例8: OnClearDIB

BOOL CUnsupportedDiskUIHandler::OnClearDIB(CDiskObjectPtr obj) const
{
	ATLASSERT( dynamic_cast<CUnitDiskObject*>(obj.get()) != NULL);

	WTL::CString strWarning;
	strWarning.FormatMessage( 
			IDS_UIHANDLER_CLEARDIB_CONFIRM,
			obj->GetTitle()
			);
	WTL::CString strTitle;
	strTitle.LoadString(IDS_APPLICATION);
	if ( MessageBox(::GetFocus(), strWarning, strTitle, MB_YESNO | MB_ICONWARNING) != IDYES )
	{
		return TRUE;
	}
	CUnitDiskObjectPtr unitDisk = 
		boost::dynamic_pointer_cast<CUnitDiskObject>(obj);
	if ( !unitDisk->CanAccessExclusive() )
	{
		WTL::CString strMsg;
		strMsg.LoadString( IDS_FAIL_TO_ACCESS_EXCLUSIVELY );
		MessageBox( 
			::GetFocus(),
			strMsg,
			strTitle,
			MB_OK | MB_ICONWARNING
			);
		return TRUE;
	}
	try {
		unitDisk->Open( TRUE );
        unitDisk->Initialize( unitDisk );
		unitDisk->CommitDiskInfo();
		unitDisk->Close();
	}
	catch( CNDASException & )
	{
		unitDisk->Close();
		WTL::CString strMsg;
		strMsg.LoadString ( IDS_UIHANDLER_CLEARDIB_FAIL );
		MessageBox( 
			::GetFocus(),
			strMsg,
			strTitle,
			MB_OK | MB_ICONERROR
			);
		return TRUE;
	}
	WTL::CString strMsg;
	strMsg.LoadString( IDS_UIHANDLER_CLEARDIB_SUCCESS );
	return TRUE;
}
开发者ID:yzx65,项目名称:ndas4windows,代码行数:52,代码来源:nbuihandler.cpp

示例9: sizeof

static 
HFONT 
pGetTitleFont()
{
	BOOL fSuccess = FALSE;
	static HFONT hTitleFont = NULL;
	if (NULL != hTitleFont) {
		return hTitleFont;
	}

	WTL::CString strFontName;
	WTL::CString strFontSize;
	fSuccess = strFontName.LoadString(IDS_BIG_BOLD_FONT_NAME);
	ATLASSERT(fSuccess);
	fSuccess = strFontSize.LoadString(IDS_BIG_BOLD_FONT_SIZE);
	ATLASSERT(fSuccess);

	NONCLIENTMETRICS ncm = {0};
	ncm.cbSize = sizeof(NONCLIENTMETRICS);
	fSuccess = ::SystemParametersInfo(
		SPI_GETNONCLIENTMETRICS, 
		sizeof(NONCLIENTMETRICS), 
		&ncm, 
		0);
	ATLASSERT(fSuccess);

	LOGFONT TitleLogFont = ncm.lfMessageFont;
	TitleLogFont.lfWeight = FW_BOLD;

	HRESULT hr = ::StringCchCopy(TitleLogFont.lfFaceName,
		(sizeof(TitleLogFont.lfFaceName)/sizeof(TitleLogFont.lfFaceName[0])),
		strFontName);

	ATLASSERT(SUCCEEDED(hr));

	INT TitleFontSize = ::StrToInt(strFontSize);
	if (TitleFontSize == 0) {
		TitleFontSize = 12;
	}

	HDC hdc = ::GetDC(NULL);
	TitleLogFont.lfHeight = 0 - 
		::GetDeviceCaps(hdc,LOGPIXELSY) * TitleFontSize / 72;

	hTitleFont = ::CreateFontIndirect(&TitleLogFont);
	::ReleaseDC(NULL, hdc);

	return hTitleFont;
}
开发者ID:yzx65,项目名称:ndas4windows,代码行数:49,代码来源:nbbindwiz.cpp

示例10: InitColumn

//////////////////////////////////////////////////////////////////////////
// CNBBindListViewCtrl
//////////////////////////////////////////////////////////////////////////
void CNBBindListViewCtrl::InitColumn()
{
	static COLUMN_INFO column_info[] = {	
		//{ _T("Index"), 45 },
		{ IDS_LISTVIEW_COL_EMPTY, 20 },
		{ IDS_LISTVIEW_COL_NAME, 120 }, 
//		{ IDS_LISTVIEW_COL_ID, 200 },
		{ IDS_LISTVIEW_COL_SIZE, 100 } 
	};
	ATLASSERT( m_nColCount <= sizeof(column_info)/sizeof(column_info[0]) );

	UINT i, nColCount;
	// Clear all the column exist
	nColCount = CListViewCtrl::GetHeader().GetItemCount();
	for ( i=0; i < nColCount; i++ )
		CListViewCtrl::DeleteColumn(0);
	// Add new columns
	for ( i=0; i < m_nColCount; i++ )
	{
		WTL::CString strHeader;
		strHeader.LoadString( column_info[i].nColHeaderID );
		CListViewCtrl::InsertColumn(
			i, strHeader, LVCFMT_LEFT, 
			column_info[i].nWidth, -1 );
	}


	int viewWidth = 90;

	SetColumnWidth(0, LVSCW_AUTOSIZE_USEHEADER);
	SetColumnWidth(2, 50);
	SetColumnWidth(1, viewWidth - GetColumnWidth(0) + GetColumnWidth(2));
}
开发者ID:,项目名称:,代码行数:36,代码来源:

示例11: ActivateUI

void CMainFrame::ActivateUI(BOOL bActivate)
{
	m_wndToolBar.EnableWindow(bActivate);	

	HMENU hMenu = ATL::CWindow::GetMenu();
	if(!hMenu)
		return;

	UINT uEnableMenuItem = (bActivate) ? MF_ENABLED : MF_GRAYED;
	EnableMenuItem(hMenu, IDM_AGGR_REFRESH, uEnableMenuItem);
	EnableMenuItem(hMenu, IDM_AGGR_BIND, uEnableMenuItem);
	EnableMenuItem(hMenu, IDM_AGGR_UNBIND, uEnableMenuItem);
	EnableMenuItem(hMenu, IDM_AGGR_ADDMIRROR, uEnableMenuItem);
	EnableMenuItem(hMenu, IDM_AGGR_SYNCHRONIZE, uEnableMenuItem);
	EnableMenuItem(hMenu, IDM_AGGR_SINGLE, uEnableMenuItem);

	if(bActivate)
	{
		::SetWindowText(m_hWndStatusBar, _T(""));
	}
	else
	{
		WTL::CString strStatusText;
		strStatusText.LoadString(IDS_STATUS_REFRESH);
		::SetWindowText(m_hWndStatusBar, strStatusText);
	}
}
开发者ID:yzx65,项目名称:ndas4windows,代码行数:27,代码来源:nbmainfrm.cpp

示例12: OnInitDialog

LRESULT CRecoverDlg::OnInitDialog(HWND /*hWndCtl*/, LPARAM /*lParam*/)
{
	ATLASSERT( m_pDevice.get() != NULL );
	CenterWindow();
	m_progBar.SubclassWindow( GetDlgItem(IDC_PROGBAR) );
	m_btnOK.Attach( GetDlgItem(IDOK) );
	m_btnCancel.Attach( GetDlgItem(IDCANCEL) );

	WTL :: CString strBtnFace;
	strBtnFace.LoadString( IDS_RECOVER_BTN_CLOSE );
	m_btnCancel.SetWindowText( strBtnFace );

	DoDataExchange(TRUE);
	m_strBindType.LoadString(m_id_bind_type);
	m_strDevice = m_pDevice->GetTitle();
	DoDataExchange(FALSE);

	WTL::CString strCaption;
	strCaption.LoadString(m_id_caption);
	SetWindowText(strCaption);

	SetPhaseText(IDS_RECOVERDLG_PHASE_READY);

	if(m_bForceStart)
		Start();

	return 0;
}
开发者ID:yzx65,项目名称:ndas4windows,代码行数:28,代码来源:nbrecoverdlgs.cpp

示例13: GetParentSheet

//////////////////////////////////////////////////////////////////////////
// Page 2
//////////////////////////////////////////////////////////////////////////
LRESULT CDiskPropertyPage2::OnInitDialog(HWND /*hWndFocus*/, LPARAM /*lParam*/)
{
	WTL::CString strCaption;
	strCaption.LoadString(IDS_DISKPROPERTYPAGE_CAPTION);
	GetParentSheet()->SetWindowText(strCaption);

	CDiskObjectPtr disk = GetParentSheet()->GetDiskObject();

	m_listProperty.SubclassWindow( GetDlgItem(IDC_LIST_PROPERTY) );
	DWORD dwStyle = LVS_EX_FULLROWSELECT; 
	//| LVS_EX_GRIDLINES 
	//| LVS_EX_INFOTIP 
	m_listProperty.SetExtendedListViewStyle( dwStyle, dwStyle );

	WTL::CString strCol[2];
	strCol[0].LoadString( IDS_DISKPROPERTYPAGE_LIST_COL_NAME );
	strCol[1].LoadString( IDS_DISKPROPERTYPAGE_LIST_COL_VALUE );
	m_listProperty.InsertColumn( 0, strCol[0], LVCFMT_LEFT, 130, -1 );
	m_listProperty.InsertColumn( 1, strCol[1], LVCFMT_LEFT, 200, -1 );

	const CObjectUIHandler *phandler = CObjectUIHandler::GetUIHandler( disk );

	PropertyList propList = phandler->GetPropertyList( disk );
	PropertyList::iterator itr;
	for ( itr = propList.begin(); itr != propList.end(); ++itr )
	{
		m_listProperty.InsertItem( itr->strName, itr->strValue, itr->strToolTip );
	}

	return 0;
}
开发者ID:yzx65,项目名称:ndas4windows,代码行数:34,代码来源:nbpropertypages.cpp

示例14: UpdateControls

VOID CBindTypePage::UpdateControls (UINT32 nType)
{
	CComboBox ctlComboBox;
	ctlComboBox.Attach(GetDlgItem(IDC_COMBO_DISKCOUNT));
	ctlComboBox.ResetContent();

	WTL::CString strDesc;

	switch(nType)
	{
	case NMT_AGGREGATE :
		ctlComboBox.InsertString(-1, _T("2"));
		ctlComboBox.InsertString(-1, _T("3"));
		ctlComboBox.InsertString(-1, _T("4"));
		ctlComboBox.InsertString(-1, _T("5"));
		ctlComboBox.InsertString(-1, _T("6"));
		ctlComboBox.InsertString(-1, _T("7"));
		ctlComboBox.InsertString(-1, _T("8"));
		strDesc.LoadString(IDS_BNZ_DESC_AGGREGATION);
		break;
	case NMT_RAID0 :
		ctlComboBox.InsertString(-1, _T("2"));
		ctlComboBox.InsertString(-1, _T("4"));
		ctlComboBox.InsertString(-1, _T("8"));
		strDesc.LoadString(IDS_BNZ_DESC_RAID0);
		break;
	case NMT_RAID1 :
		ctlComboBox.InsertString(-1, _T("2"));
		strDesc.LoadString(IDS_BNZ_DESC_RAID1);
		break;
	case NMT_RAID4 :
		ctlComboBox.InsertString(-1, _T("3"));
		ctlComboBox.InsertString(-1, _T("5"));
		ctlComboBox.InsertString(-1, _T("9"));
		strDesc.LoadString(IDS_BNZ_DESC_RAID4);
		break;
	default:
		break;
	}

	ctlComboBox.SetCurSel(0);

	CStatic ctlStatic;
	ctlStatic.Attach(GetDlgItem(IDC_BIND_TYPE_DESCRIPTION));
	ctlStatic.SetWindowText(strDesc);

}
开发者ID:yzx65,项目名称:ndas4windows,代码行数:47,代码来源:nbbindwiz.cpp

示例15: GetStringID

WTL::CString CEmptyDiskUIHandler::GetStringID(CDiskObjectPtr obj) const
{
	WTL::CString strDashedID;
	strDashedID.LoadString(IDS_UNIDEV_TYPE_DISK_EMPTY);

	return strDashedID;

}
开发者ID:yzx65,项目名称:ndas4windows,代码行数:8,代码来源:nbuihandler.cpp


注:本文中的wtl::CString::LoadString方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。