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


C++ LoadStringResource函数代码示例

本文整理汇总了C++中LoadStringResource函数的典型用法代码示例。如果您正苦于以下问题:C++ LoadStringResource函数的具体用法?C++ LoadStringResource怎么用?C++ LoadStringResource使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


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

示例1: LoadStringResource

void 
CXRefreshToolbar::HandleError(const CString &errorMessage)
{
	CString message = LoadStringResource(IDS_ERROR_BASEMESSAGE);
	message += errorMessage;
	::MessageBox(NULL, message, LoadStringResource(IDS_TOOLBAR_NAME), MB_OK | MB_ICONERROR);
}
开发者ID:chzh,项目名称:xrefresh,代码行数:7,代码来源:XRefreshToolbar.cpp

示例2: UpdateData

void CForceSyncDlg::OnOK() 
{
	m_WinPos.SaveWindowPosition();
	UpdateData( );
	if (m_Action == 1)
	{
		if (IDYES != AfxMessageBox(IDS_ASK_FORCE_RESYNC, MB_YESNO | MB_ICONQUESTION))
			return;
	}
	else
	{
		int index=m_ChangeCombo.GetCurSel();
		CString txt;
		m_ChangeCombo.GetLBText(index, txt);
		if(txt.Compare(LoadStringResource(IDS_DEFAULTCHANGELISTNAME)) == 0)
			m_SelectedChange= 0;
		else if(txt.Compare(LoadStringResource(IDS_NEWCHANGELISTNAME)) == 0)
		{
			m_SelectedChange= MainFrame()->CreateNewChangeList(m_Key);
			if (m_SelectedChange == -1)	// the user bailed
				return;
		}
		else
			m_SelectedChange=_ttol(txt);
	}
	CDialog::OnOK();
}
开发者ID:danieljennings,项目名称:p4win,代码行数:27,代码来源:ForceSyncDlg.cpp

示例3: UpdateData

void CBookmarks::OnAddSubmenu() 
{
	if (m_NbrSubMenus < MAX_BOOKMARK_SUBMENUS)
	{
		CToolsAdd dlg;
		dlg.SetTitle(LoadStringResource(IDS_ADD_BOOKMARK_SUBMENU));
		dlg.SetRadioShow(3);
		if ((dlg.DoModal() == IDOK) && ((dlg.GetNewMenuName()).GetLength()))
		{
			UpdateData();
			CString txt = dlg.GetNewMenuName();
			if ((m_CurSel = m_MenuItemList.AddString(txt)) >= 0)
			{
				txt += LoadStringResource(IDS_A_SUBMENU);
				m_MenuItemList.DeleteString(m_CurSel);
				m_MenuItemList.InsertString(m_CurSel, txt);
				m_BkMkMenuName[m_CurSel] = dlg.GetNewMenuName();
				m_NbrSubMenus++;
				m_BkMkIsSubMenu[m_CurSel] = TRUE;
				if (m_CurSel < m_1stSubmenu)
					m_1stSubmenu = m_CurSel;
				UpdateData( FALSE );
				m_MenuItemList.SetCurSel(m_CurSel);
				if (m_CurSel >= MAX_BOOKMARKS-1)
					GetDlgItem(IDC_ADD)->EnableWindow(FALSE);
				GetDlgItem(IDC_CHANGE)->EnableWindow(TRUE);
				GetDlgItem(IDC_REMOVE)->EnableWindow(TRUE);
				GetDlgItem(IDC_EXPORT)->EnableWindow(TRUE);
				UpdateData( FALSE );
			}
		}
	}
}
开发者ID:danieljennings,项目名称:p4win,代码行数:33,代码来源:Bookmarks.cpp

示例4: MessageBeep

void CBookmarks::OnChangeSubmenu() 
{
	if (m_CurSel == -1)
	{
		MessageBeep(0);
		return;
	}
	CToolsAdd dlg;
	dlg.SetTitle(LoadStringResource(IDS_EDIT_BOOKMARK_SUBMENU));
	dlg.SetNewMenuName(m_BkMkMenuName[m_CurSel]);
	dlg.SetIsSubMenu(TRUE);
	dlg.SetRadioShow(3);
	if ((m_NbrSubMenus < MAX_BOOKMARK_SUBMENUS) || m_BkMkIsSubMenu[m_CurSel])
		dlg.SetCanCr8SubMenu(TRUE);
	if ((dlg.DoModal() == IDOK) && ((dlg.GetNewMenuName()).GetLength()))
	{
		m_BkMkMenuName[m_CurSel] = dlg.GetNewMenuName();
		CString txt = dlg.GetNewMenuName() + LoadStringResource(IDS_A_SUBMENU);
		m_MenuItemList.DeleteString(m_CurSel);
		m_MenuItemList.InsertString(m_CurSel, txt);
		if (m_CurSel < m_1stSubmenu)
		{
			m_1stSubmenu = m_CurSel;
			LoadMenuItemList();
		}
		UpdateData( FALSE );
		m_MenuItemList.SetCurSel(m_CurSel);
	}
}
开发者ID:danieljennings,项目名称:p4win,代码行数:29,代码来源:Bookmarks.cpp

示例5: GET_P4REGPTR

LRESULT CLabelListCtrl::OnDoLabelSync(WPARAM wParam, LPARAM lParam)
{
	BOOL preview = FALSE;
	if (wParam == IDOK)
	{
		preview = lParam;
		if (!preview)
			GET_P4REGPTR()->SetLabelAddRplDefault(m_AddReplaceDlg->m_DefaultFlag);
		if (m_AddReplaceList.GetCount())
		{
			CCmd_LabelSynch *pCmd= new CCmd_LabelSynch;
			pCmd->Init( m_hWnd, RUN_ASYNC);
			if( pCmd->Run( m_AddReplaceName, &m_AddReplaceList, preview, FALSE, 
							m_AddReplaceDlg->m_FilesFlag==2 ) )
				MainFrame()->UpdateStatus( LoadStringResource(IDS_SYNCING_LABEL) );	
			else
				delete pCmd;
		}
		else AddToStatus(LoadStringResource(IDS_NOTHING_SELECTED_NOTHING_TO_DO));
	}
	if (m_AddReplaceDlg && !preview)
	{
		m_AddReplaceDlg->DestroyWindow();	// deletes m_AddReplaceDlg
		m_AddReplaceDlg = 0;
		MainFrame()->SetModelessUp(FALSE);
	}
	return 0;
}
开发者ID:danieljennings,项目名称:p4win,代码行数:28,代码来源:LabelListCtrl.cpp

示例6: GET_P4REGPTR

CString CClientListCtrl::SetCaption()
{
	int i = GET_P4REGPTR()->GetClientFilteredFlags();
	if (i)
    {
        CString filter;
		CString txt;

		if (i & 0x10)
			txt = LoadStringResource(IDS_CURRENT_USER);
		else if (i & 0x01)
			txt = GET_P4REGPTR()->GetClientFilterOwner();
		if (i & 0x22)
		{
			if (!txt.IsEmpty())
				txt += _T(", ");
			txt += i & 0x20 ? GET_P4REGPTR()->GetHostname() : GET_P4REGPTR()->GetClientFilterHost();
		}
		if (i & 0x04)
		{
			if (!txt.IsEmpty())
				txt += _T(", ");
			txt += CString(_T("\"")) + GET_P4REGPTR()->GetClientFilterDesc() + _T("\"");
		}
		filter.FormatMessage(IDS_FILTERED, txt);
		m_caption = LoadStringResource(IDS_PERFORCE_CLIENTS) + filter;
    }
	else
		m_caption = LoadStringResource(IDS_PERFORCE_CLIENTS);

	CP4PaneContent::GetView()->SetCaption();

	return m_caption;
}
开发者ID:danieljennings,项目名称:p4win,代码行数:34,代码来源:ClientListCtrl.cpp

示例7: GetParentFrame

void CLabelListCtrl::OnContextMenu(CWnd* pWnd, CPoint point) 
{
	//		make sure window is active
	//
	GetParentFrame()->ActivateFrame();

	// If one of the label modeless dialogs is up, don't display a context menu
	// instead set the focus to the modeless dialog.
	if (m_AddReplaceDlg)
	{
		m_AddReplaceDlg->SetFocus();
		return;
	}
	if (m_DelSyncDlg)
	{
		m_DelSyncDlg->SetFocus();
		return;
	}

	///////////////////////////////
	// See ContextMenuRules.txt for order of menu commands!

	//		create an empty context menu
	//
	CP4Menu popMenu;
	popMenu.CreatePopupMenu();

	int	index;
    SetIndexAndPoint( index, point );

	// Can always create new label
	popMenu.AppendMenu(MF_ENABLED | MF_STRING, ID_LABEL_NEW );

	if(index != -1)
	{
		// Make sure item is selected
		SetItemState(index, LVIS_SELECTED|LVIS_FOCUSED, LVIS_DROPHILITED|LVIS_SELECTED|LVIS_FOCUSED );

		popMenu.AppendMenu(MF_ENABLED | MF_STRING, ID_LABEL_EDIT_SPEC );
		popMenu.AppendMenu(MF_ENABLED | MF_STRING, ID_LABEL_DESCRIBE );
		popMenu.AppendMenu(MF_ENABLED | MF_STRING, ID_LABEL_DELETE );
		popMenu.AppendMenu(MF_ENABLED | MF_STRING, ID_LABEL_TEMPLATE );
		popMenu.AppendMenu(MF_SEPARATOR);
		popMenu.AppendMenu(MF_ENABLED | MF_STRING, ID_LABEL_LISTFILES );
		popMenu.AppendMenu(MF_ENABLED | MF_STRING, ID_LABEL_SYNC );
		popMenu.AppendMenu(MF_ENABLED | MF_STRING, ID_LABEL_DELETEFILES );
		popMenu.AppendMenu(MF_ENABLED | MF_STRING, ID_LABEL_SYNC_CLIENT );
		popMenu.AppendMenu(MF_ENABLED | MF_STRING, ID_LABEL_ADDTOLABELVIEW );
		popMenu.AppendMenu(MF_ENABLED | MF_STRING, ID_LABEL_DIFF2, LoadStringResource(IDS_LABEL_DIFF2) );
	}	

	popMenu.AppendMenu( MF_SEPARATOR );
	if(m_LabelFilterView.GetCount() > 0)
		popMenu.AppendMenu(MF_ENABLED | MF_STRING, ID_LABELFILTER_CLEARVIEW, LoadStringResource( IDS_CLEARFILTER ) );
	popMenu.AppendMenu(MF_ENABLED | MF_STRING, ID_VIEW_UPDATE, LoadStringResource(IDS_REFRESH) );
	
	MainFrame()->AddToolsToContextMenu(&popMenu);

	popMenu.TrackPopupMenu(TPM_LEFTALIGN | TPM_RIGHTBUTTON,	point.x, point.y, AfxGetMainWnd());
}
开发者ID:danieljennings,项目名称:p4win,代码行数:60,代码来源:LabelListCtrl.cpp

示例8: _T

CUserListCtrl::CUserListCtrl()
{
    m_SortAscending=TRUE;
    m_viewType = P4USER_SPEC;
	m_OldDefUser = m_OldCurUser = _T("@");

    m_CF_DEPOT = static_cast<CLIPFORMAT>(RegisterClipboardFormat(LoadStringResource(IDS_DRAGFROMDEPOT)));
	m_CF_USER  = static_cast<CLIPFORMAT>(RegisterClipboardFormat(LoadStringResource(IDS_DRAGFROMUSER)));
	m_caption  = m_captionplain = LoadStringResource(IDS_PERFORCE_USERS);
}
开发者ID:danieljennings,项目名称:p4win,代码行数:10,代码来源:UserListCtrl.cpp

示例9: fDlg

void CViewerDlg::OnFindviewer() 
{
	// Fire up a common dlg to find new file
	CFileDialog fDlg(TRUE, LoadStringResource(IDS_VIEWERDLG_EXTENSION), NULL,  
		OFN_FILEMUSTEXIST | OFN_HIDEREADONLY | OFN_NONETWORKBUTTON | OFN_PATHMUSTEXIST,
		LoadStringResource(IDS_VIEWERDLG_FILTER), this,
		MainFrame()->m_osVer.dwMajorVersion < 5 ? OPENFILENAME_SIZE_VERSION_400 : sizeof(OPENFILENAME)); 

	if(fDlg.DoModal() == IDOK)
	{
		m_Viewer= fDlg.GetPathName();
		EndDialog(IDOK);
	}
}
开发者ID:danieljennings,项目名称:p4win,代码行数:14,代码来源:ViewerDlg.cpp

示例10: CString

BOOL CCmd_Delete::HandledCmdSpecificError(LPCTSTR errBuf, LPCTSTR errMsg)
{
	m_FatalError = TRUE;

    if( StrStr(errBuf, _T("use -f to force delete")))
	{
		CString m;
        m.FormatMessage(IDS_CANT_DELETE_PRIVELEGE_s, 
            CString(errBuf, StrStr(errBuf, _T("; use -f")) - errBuf ));
		TheApp()->StatusAdd( m, SV_ERROR);
		return m_FatalError;
	}

	if(StrStr(errBuf, _T("Can't delete client")) && StrStr(errBuf, _T("owned by")))
	{
		TheApp()->StatusAdd(LoadStringResource(IDS_CANT_DELETE_UNOWNED_CLIENT), SV_ERROR);
		return m_FatalError;
	}

	if(StrStr(errBuf, _T("Can't delete label")))
	{
		if(StrStr(errBuf, _T("owned by")))
			TheApp()->StatusAdd( LoadStringResource(IDS_CANT_DELETE_UNOWNED_LABEL), SV_ERROR);
		else
			TheApp()->StatusAdd(errMsg, SV_ERROR );
		return m_FatalError;
	}

	if(StrStr(errBuf, _T("Can't delete branch")))
	{
		if(StrStr(errBuf, _T("owned by")))
			TheApp()->StatusAdd( LoadStringResource(IDS_CANT_DELETE_UNOWNED_BRANCH), SV_ERROR);
		else
			TheApp()->StatusAdd(errMsg, SV_ERROR);
		return m_FatalError;
	}

	if (( StrStr(errBuf, _T("don't have permission"))) 
	 || ( StrStr(errBuf, _T("is locked and can't be deleted"))))

	{
		TheApp()->StatusAdd( errMsg, SV_ERROR );
		return m_FatalError;
	}

	m_FatalError = FALSE;
	return m_FatalError;
}
开发者ID:danieljennings,项目名称:p4win,代码行数:48,代码来源:Cmd_Delete.cpp

示例11: _T

BOOL CCmd_SendSpec::HandledCmdSpecificError(LPCTSTR errBuf, LPCTSTR errMsg)
{
    m_ErrorTxt.Empty();

    // Omit message about line number, if present
    CString omit= _T("\nError detected at line");

    LPCTSTR pStartOmit= StrStr(errMsg, omit);

    if( pStartOmit )
    {
        LPCTSTR pEndOmit = StrChr(pStartOmit+1, _T('\n'));

        if( pEndOmit )
            m_ErrorTxt = CString(errMsg).Left(pStartOmit - errMsg) + pEndOmit;
    }
    else
        m_ErrorTxt = errMsg;

	if (StrStr(errBuf, _T("You cannot use the default branch view;")))
		m_ErrorTxt += LoadStringResource(IDS_YOUMUSTCHANGETHEVIEW);

    // replace message about submit failure, if present
    int startSubmit = m_ErrorTxt.Find(_T("Submit failed"));
    if(startSubmit > -1)
	{
		m_ErrorTxt = m_ErrorTxt.Left(startSubmit)
            + LoadStringResource(IDS_SUBMIT_FAILED_CORRECT_AND_RESUBMIT);
	}
	else if ((errBuf != errMsg) && StrStr(errBuf, _T("Submit failed")))
	{
		m_ErrorTxt.TrimRight();
		startSubmit = m_ErrorTxt.ReverseFind(_T('\n'));
		if(startSubmit > -1)
		{
			m_ErrorTxt = m_ErrorTxt.Left(startSubmit+1)
				+ LoadStringResource(IDS_SUBMIT_FAILED_CORRECT_AND_RESUBMIT);
		}
		m_ErrorTxt += _T("\n");
	}

    // Put the error into the status bar.  Let the UI thread pop the
	// error dialog so there isnt a window on-topness problem
	TheApp()->StatusAdd( m_ErrorTxt, SV_WARNING );

	m_FatalError= TRUE;
	return TRUE;
}
开发者ID:danieljennings,项目名称:p4win,代码行数:48,代码来源:Cmd_SendSpec.cpp

示例12: CString

BOOL CClientListCtrl::AutoCreateClientSpec(LPCTSTR clientName, LPCTSTR clientRoot, 
										   BOOL bEdit, BOOL bTmpl, LPCTSTR tmplate)
{
	m_pNewSpec= new CP4Client;

	CCmd_EditSpec *pCmd= new CCmd_EditSpec;
	pCmd->Init(m_hWnd, RUN_ASYNC, HOLD_LOCK);
	if (bTmpl && !(CString(GET_P4REGPTR()->GetLocalCliTemplate()).IsEmpty())
	 && CString(tmplate) == CString(LOCALDEFTEMPLATE))
	{
		pCmd->SetUseLocalDefTmplate(TRUE);
		bTmpl = FALSE;
		bEdit = TRUE;
	}
	else
		pCmd->SetNewClientRoot(clientRoot);
	pCmd->SetAutoUpdateSpec(bEdit ? FALSE : TRUE);
	BOOL b;
	if (bTmpl)
		b = pCmd->Run( P4CLIENT_SPEC, clientName, tmplate, m_pNewSpec );
	else
		b = pCmd->Run( P4CLIENT_SPEC, clientName, m_pNewSpec );
	if( b )
	{
		MainFrame()->UpdateStatus( LoadStringResource(IDS_EDITING_CLIENT_SPEC) ) ;
		return TRUE;
	}
	delete pCmd;
	delete m_pNewSpec;
	return FALSE;
}
开发者ID:danieljennings,项目名称:p4win,代码行数:31,代码来源:ClientListCtrl.cpp

示例13: AddToStatus

LRESULT CForceSyncDlg::OnP4Diff(WPARAM wParam, LPARAM lParam)
{
	CCmd_Diff *pCmd= (CCmd_Diff *) wParam;
    
	if(!pCmd->GetError())
	{
		int cnt;
		if ((cnt = pCmd->GetDiffRunCount()) == 0)
		{
			if (pCmd->GetDiffNbrFiles() == 1)
            {
                CString msg;
                msg.FormatMessage(IDS_CLIENT_FILE_s_DOES_NOT_DIFFER_FROM_DEPOT_FILE,
						pCmd->GetDiffFileName());
				AddToStatus(msg, SV_COMPLETION);
            }
			else if (pCmd->GetDiffErrCount() == 0)
				AddToStatus(LoadStringResource(IDS_NONE_OF_THE_SELECTED_CLIENT_FILES_DIFFER), SV_COMPLETION);
		}
		else if (cnt < pCmd->GetDiffNbrFiles())
		{
			CString txt;
			int i = pCmd->GetDiffNbrFiles() - cnt;
            if(i == 1)
                txt.FormatMessage(IDS_ONECLIENTFILEDOESNOTDIFFER);
            else
                txt.FormatMessage(IDS_SEVERALCLIENTFILESDONOTDIFFER_n, i);
			AddToStatus(txt, SV_COMPLETION);
		}
	}
    
	delete pCmd;
	MainFrame()->ClearStatus();
	return 0;
}
开发者ID:danieljennings,项目名称:p4win,代码行数:35,代码来源:ForceSyncDlg.cpp

示例14: ListView_GetItemText

void CP4ListBrowse::OnDescribe( void )
{
    int nItem=m_P4ListCtrl.GetNextItem( -1, LVNI_ALL | LVNI_SELECTED );
    if (nItem != -1)
    {
        TCHAR str[ LISTVIEWNAMEBUFSIZE + 1 ];
        ListView_GetItemText( m_P4ListCtrl.m_hWnd, nItem, 0, str, LISTVIEWNAMEBUFSIZE );
        m_SelectedP4Object = str;
        if ( m_SelectedP4Object.IsEmpty( ) )
            return;
    }
    else
        return;

    CCmd_Describe *pCmd = new CCmd_Describe;
    pCmd->Init( m_pParent->m_hWnd, RUN_ASYNC );
    pCmd->SetCaller(this);
    pCmd->SetListCtrl(&m_P4ListCtrl);
    if( pCmd->Run( m_viewType, m_SelectedP4Object ) )
    {
        MainFrame()->UpdateStatus( LoadStringResource(IDS_FETCHING_SPEC) );
        return;
    }
    else
    {
        delete pCmd;
        return;
    }
}
开发者ID:lpseguin,项目名称:p4win,代码行数:29,代码来源:P4ListBrowse.cpp

示例15: _T

BOOL CCmd_Fstat::HandledCmdSpecificError(LPCTSTR errBuf, LPCTSTR errMsg)
{
    if ((StrStr(errBuf, _T(" - file(s) not in client view")))
	 ||	(StrStr(errBuf, _T(" - protected namespace - access denied")))
	 || (m_bWorking && StrStr(errBuf, _T(" - file(s) not opened on this client"))))
	{
        return TRUE;
	}
    else if ((GET_P4REGPTR( )->ShowEntireDepot( ) > SDF_DEPOT)
		  && (StrStr(errBuf, _T(" - no mappings in client view"))))
	{
		m_ErrorList.AddHead(errBuf);
        return TRUE;
	}
	else if ( StrStr(errBuf, _T("no such file") )  )
	{
		TheApp()->StatusAdd( LoadStringResource(IDS_NO_FILES_UNDER_FOLDER), SV_DEBUG );  
		return TRUE ; 
	}
	else if ( StrStr(errBuf, _T(" database access failed.") )  )
	{
		m_FatalError = TRUE;
		return FALSE;
	}

	return StrStr(errBuf, _T("up-to-date.") ) != 0;
}
开发者ID:danieljennings,项目名称:p4win,代码行数:27,代码来源:Cmd_Fstat.cpp


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