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


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

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


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

示例1: Find

void CFindDlg::Find(int nSearchFlags, bool bNext)
{
	// try to find text
	if (!m_pEdit) return;

	if (bNext)
	{
		CString strFind;
		m_ctrlSearchtext.GetWindowText(strFind);
		StoreSearchString ((CGumpEditorApp*)AfxGetApp(), strFind);
		m_pEdit->SetSearchflags(nSearchFlags);
		if(!m_pEdit->SearchForward(strFind.LockBuffer()))
		{
			MessageBeep(0);
		}
		strFind.UnlockBuffer();
	}
	else
	{
		CString strFind;
		m_ctrlSearchtext.GetWindowText(strFind);
		StoreSearchString ((CGumpEditorApp*)AfxGetApp(), strFind);
		m_pEdit->SetSearchflags(nSearchFlags);
		if(!m_pEdit->SearchBackward(strFind.LockBuffer()))
		{
			MessageBeep(0);
		}
		strFind.UnlockBuffer();
	}
}
开发者ID:Admin-Yukiko,项目名称:Iris1_DeveloperTools,代码行数:30,代码来源:FindDlg.cpp

示例2: CopyItem

HTREEITEM EXTreeCtrl::CopyItem(HTREEITEM hItem, HTREEITEM htiNewParent, HTREEITEM htiAfter)
{
    TV_INSERTSTRUCT	tvstruct;
    HTREEITEM	hNewItem;
    CString	sText;

    // get information of the source item
    tvstruct.item.hItem = hItem;
    tvstruct.item.mask = TVIF_CHILDREN | TVIF_HANDLE |
                         TVIF_IMAGE | TVIF_SELECTEDIMAGE;
    GetItem(&tvstruct.item);
    sText = GetItemText( hItem );

    tvstruct.item.cchTextMax = sText.GetLength();
    tvstruct.item.pszText = sText.LockBuffer();

    // Insert the item at proper location
    tvstruct.hParent = htiNewParent;
    tvstruct.hInsertAfter = htiAfter;
    tvstruct.item.mask = TVIF_IMAGE | TVIF_SELECTEDIMAGE | TVIF_TEXT;
    hNewItem = InsertItem(&tvstruct);
    sText.ReleaseBuffer();

    // Now copy item data and item state.
    SetItemData( hNewItem, GetItemData( hItem ));
    SetItemState( hNewItem, GetItemState( hItem, TVIS_STATEIMAGEMASK ),
                  TVIS_STATEIMAGEMASK );

//		ins.item.lParam = (LPARAM)(pItem);

    // Call virtual function to allow further processing in derived class
    //  OnItemCopied( hItem, hNewItem );

    return hNewItem;
}
开发者ID:sosoayaen,项目名称:DescentBoardGameTools,代码行数:35,代码来源:EXTreeCtrl.cpp

示例3: OnToolHitTest

int CLogo::OnToolHitTest(CPoint point, TOOLINFO *pTI) const
{
	CString ToolTipText;

	if(::IsWindow(m_hWnd) && ToolTipText.LoadString(GetDlgCtrlID()))
	{
		int nDelPos = ToolTipText.Find(_T('\n'));
		if(nDelPos != -1)
			ToolTipText = ToolTipText.Right(ToolTipText.GetLength()-nDelPos-1);
	}

	if(ToolTipText.IsEmpty())
		return -1;

	int nLen = ToolTipText.GetLength();
	PTCHAR pText = PTCHAR(::malloc((nLen+1)*sizeof(TCHAR)));
	if(!pText)
		return -1;

	::_tcscpy(pText,ToolTipText.LockBuffer());
	ToolTipText.UnlockBuffer();
	pTI->lpszText = pText;
	pTI->hwnd = m_hWnd;

	CRect ClientRect;
	GetClientRect(ClientRect);
	pTI->rect.left = ClientRect.left;
	pTI->rect.top = ClientRect.top;
	pTI->rect.right = ClientRect.right;
	pTI->rect.bottom = ClientRect.bottom;

	return 1;
}
开发者ID:brygid,项目名称:ProcessExplorer,代码行数:33,代码来源:Logo.cpp

示例4: show_message

void CSTATUS_DIALOG::show_message(UINT msg_id)
{
	CString msg;
	msg.LoadString(msg_id);
	show_message(msg.LockBuffer());
	msg.UnlockBuffer();
}
开发者ID:liquanhai,项目名称:cxm-hitech-matrix428,代码行数:7,代码来源:STATUS_DIALOG.cpp

示例5: SwapLTALTC

bool SwapLTALTC(CString &sFilename)
{
	// If it's too short, it's not an option
	if (sFilename.GetLength() < 4)
		return false;

	// Point at the end of the string
	char *pBuffer = sFilename.LockBuffer();
	char *pLastChar = &pBuffer[sFilename.GetLength() - 1];

	bool bResult = true;

	// Make sure it's LT? for the extension
	if ((pLastChar[-3] != '.') ||
		(toupper(pLastChar[-2]) != 'L') ||
		(toupper(pLastChar[-1]) != 'T'))
	{
		bResult = false;
	}
	// Switch it
	else if (toupper(*pLastChar) == 'A')
		*pLastChar = 'C';
	else if (toupper(*pLastChar) == 'C')
		*pLastChar = 'A';
	else
		bResult = false;

	sFilename.UnlockBuffer();
	return bResult;
}
开发者ID:Joincheng,项目名称:lithtech,代码行数:30,代码来源:PrefabMgr.cpp

示例6: DecryptEMailServerPassword

CString CDlgSettingFtpEmail::DecryptEMailServerPassword(CString csEncrypt)
{
	CString csDecrypt;
	CByteArray cbArray2;

	LPCSTR lpSTR;
	USES_CONVERSION;
	lpSTR = W2A(csEncrypt.LockBuffer());
	csEncrypt.UnlockBuffer();

	unsigned char hexdata[32];

	memset(hexdata, 0, sizeof(unsigned char)*32);

	strtohex(lpSTR, hexdata);

	cbArray2.SetSize(csEncrypt.GetLength()/2);

	for(int iTemp = 0; iTemp < (csEncrypt.GetLength()/2); iTemp++)
	{
		cbArray2[iTemp] = (BYTE)hexdata[iTemp];
	}

	m_CCrypto.Decrypt(cbArray2, csDecrypt);

	return csDecrypt;
}
开发者ID:YTYOON,项目名称:eNVR,代码行数:27,代码来源:DlgSettingFtpEmail.cpp

示例7: OnChildNotify

BOOL CWndIndirectTalk::OnChildNotify( UINT message, UINT nID, LRESULT* pLResult ) 
{ 
	CWorld* pWorld = g_WorldMng();
	CObj* pObj = pWorld->GetObjFocus();
	if( pObj && pObj->GetType() == OT_MOVER )
	{
		switch( nID )
		{
		case WIDC_EDIT2: // 본문 
			if( message != EN_RETURN )
				break;
		case WIDC_BUTTON1:
			{
				CWndEdit* pWndEdit1 = (CWndEdit*)GetDlgItem( WIDC_EDIT1 );
				CWndEdit* pWndEdit2 = (CWndEdit*)GetDlgItem( WIDC_EDIT2 );
				LPCTSTR lpId = pWndEdit1->m_string;
				LPCTSTR lpText = pWndEdit2->m_string;
				CString string;
				string.Format( "/id %s %s", lpId, lpText );
				ParsingCommand( string.LockBuffer(), g_pPlayer );
				string.UnlockBuffer();
				pWndEdit2->Empty();
			}
			break;
		}
	}
	if( nID == WTBID_CLOSE )
	{
		Destroy( TRUE );
		return TRUE;
	}
	return CWndNeuz::OnChildNotify( message, nID, pLResult ); 
} 
开发者ID:iceberry,项目名称:flyffsf,代码行数:33,代码来源:WndIndirectTalk.cpp

示例8: CopyTreeItem

HTREEITEM CTreeViewEx::CopyTreeItem( HTREEITEM hItem, HTREEITEM hNewParentItem,HTREEITEM hAfterItem )
{
        TV_INSERTSTRUCT tvstruct;
        HTREEITEM   hNewItem;
        CString sText;
        CTreeCtrl& omTreeCtrl = GetTreeCtrl();
        // get information of the source item
        tvstruct.item.hItem = hItem;
        tvstruct.item.mask = TVIF_CHILDREN | TVIF_HANDLE | TVIF_IMAGE | TVIF_SELECTEDIMAGE ;
        omTreeCtrl.GetItem(&tvstruct.item);  
        sText = omTreeCtrl.GetItemText( hItem );
        
        tvstruct.item.cchTextMax = sText.GetLength();
        tvstruct.item.pszText = sText.LockBuffer();

        // Insert the item at proper location
        tvstruct.hParent = hNewParentItem;
        tvstruct.hInsertAfter = hAfterItem;
        tvstruct.item.mask = TVIF_IMAGE | TVIF_SELECTEDIMAGE | TVIF_TEXT;
        hNewItem = omTreeCtrl.InsertItem(&tvstruct);
        sText.ReleaseBuffer();

        // Now copy item data and item state.
        omTreeCtrl.SetItemData( hNewItem, omTreeCtrl.GetItemData( hItem ));
        omTreeCtrl.SetItemState( hNewItem, omTreeCtrl.GetItemState( hItem, TVIS_STATEIMAGEMASK ), 
                                                        TVIS_STATEIMAGEMASK );

        return hNewItem;
}
开发者ID:RBEI-ArunKumar,项目名称:busmaster,代码行数:29,代码来源:TreeViewEx.cpp

示例9: FillTreeView

void CFunctionPage::FillTreeView(HTREEITEM hRootItem, MessageStruct* pMes)
{
	if ((int)_AtlModule.m_eWTLVersion < eWTL75 && pMes->Type & REFLECTION_MESSAGE)
		return;

	TVITEM* tvi;
	TVINSERTSTRUCT tvis;
	ZeroMemory(&tvis, sizeof(tvis));
	tvi = &tvis.item;
	tvi->mask = TVIF_TEXT | TVIF_PARAM | TVIF_IMAGE | TVIF_SELECTEDIMAGE;
	tvi->lParam = (LPARAM)pMes;
	CString Name = pMes->Message;

	LPTSTR pName = Name.LockBuffer();
	tvi->pszText = pName;
	tvi->cchTextMax = Name.GetLength() + 1;
	int Type = pMes->Type & TYPE_MASK;
	if (pMes->IconIndex == -1)
	{
		if (Type == ROOT_PLACE)
		{
			tvi->iImage = 0;
			tvi->iSelectedImage = 0;
		}
		else
		{
			tvi->iImage = 2;
			tvi->iSelectedImage = 2;
		}
	}
	else
	{
		tvi->iSelectedImage = tvi->iImage = pMes->IconIndex;
	}
	tvi->cChildren = 0;
	tvis.hParent = hRootItem;
	int Flags = pMes->Type & FLAGS_MASK;
	if (Flags & CUSTOM_MESSAGE)
	{
		tvis.hInsertAfter = TVI_LAST;
	}
	else
	{
		tvis.hInsertAfter = TVI_SORT;
	}
	HTREEITEM NewItem = m_Messages.InsertItem(&tvis);
	Name.UnlockBuffer();

	if (Type == ROOT_PLACE)
	{
		for (size_t i = 0; i < pMes->Children.GetCount(); i++)
		{
			FillTreeView(NewItem, pMes->Children[i]);
		}
	}
}
开发者ID:axxapp,项目名称:winxgui,代码行数:56,代码来源:FunctionPage.cpp

示例10: MoveChildItem

HTREEITEM CZoneTree::MoveChildItem(HTREEITEM hItem, HTREEITEM htiNewParent, HTREEITEM htiAfter)
{
	TV_INSERTSTRUCT tvstruct;
	HTREEITEM hNewItem;
    CString sText;
	int i;

    // get information of the source item
    tvstruct.item.hItem = hItem;
    tvstruct.item.mask = TVIF_CHILDREN | TVIF_HANDLE | TVIF_IMAGE | TVIF_SELECTEDIMAGE;
    GetItem(&tvstruct.item);  
    sText = GetItemText( hItem );
        
    tvstruct.item.cchTextMax = sText.GetLength();
    tvstruct.item.pszText = sText.LockBuffer();

    //insert the item at proper location
    tvstruct.hParent = htiNewParent;
    tvstruct.hInsertAfter = htiAfter;
    tvstruct.item.mask = TVIF_IMAGE | TVIF_SELECTEDIMAGE | TVIF_TEXT;
    hNewItem = InsertItem(&tvstruct);
    sText.ReleaseBuffer();
	
	GetItemImage(hNewItem, i, i);

	switch(i) {
	case OBJECT_DATA:
		ConvertObjToIndex(hItem, hNewItem, htiNewParent);
		break;
	case OBJ_INDEX:
		CopyObjIndex(hItem, hNewItem, htiNewParent);
		break;
	case MOB_DATA:
		ConvertMobToIndex(hItem, hNewItem, htiNewParent);
		break;
	case MOB_INDEX:
		CopyMobIndex(hItem, hNewItem, htiNewParent);
		break;
	}

    SetItemState(hNewItem,GetItemState(hItem,TVIS_STATEIMAGEMASK),TVIS_STATEIMAGEMASK);

	HTREEITEM hItemChild = GetChildItem(hItem);
	
	while (hItemChild != NULL)
	{
		HTREEITEM hItemNextChild = GetNextSiblingItem(hItemChild);
		MoveChildItem(hItemChild, hNewItem, TVI_LAST);
		hItemChild = hItemNextChild;
	}
	
    return hNewItem;
}
开发者ID:GalacticSoft,项目名称:DikuEdit,代码行数:53,代码来源:ZoneTree.cpp

示例11: AddDiskObject

void CNBListViewCtrl::AddDiskObject(CNBUnitDevice *o)
{
	LVITEM lvItem = { 0 };
	CString strName = o->GetName();

	lvItem.mask		= LVIF_TEXT | LVIF_PARAM;
	lvItem.iItem	= GetItemCount();
	lvItem.pszText	= strName.LockBuffer();
	lvItem.lParam	= (LPARAM)o;
	CListViewCtrl::InsertItem( &lvItem );
	CListViewCtrl::SetItemText(lvItem.iItem, 1, o->GetCapacityString());
}
开发者ID:tigtigtig,项目名称:ndas4windows,代码行数:12,代码来源:nblistviewctrl.cpp

示例12: FirstCharBig

void Speller::FirstCharBig(CString& s){
	LPTSTR bf=s.LockBuffer();
	for(;*bf;bf++){
		if( isalpha2(*bf) ){
			*bf &= ~0x20;
			bf++;
			break;
		}
	}
	_tcslwr(bf); //остаток строки - вниз
	s.UnlockBuffer();
}
开发者ID:open2cerp,项目名称:Open2C-ERP,代码行数:12,代码来源:SPELL.cpp

示例13: Localize

void CDetailInfo::Localize()
{
	if (NULL == GetSafeHwnd())
		return;

	LVCOLUMN	lc;
	CString		str;

	lc.mask = LVCF_TEXT;

	str = GetResString(IDS_DETAILINFO_NAME);
	lc.pszText = str.LockBuffer();
	m_ListDetail.SetColumn(0, &lc);
	str.UnlockBuffer();

	str = GetResString(IDS_DETAILINFO_VALUE);
	lc.pszText = str.LockBuffer();
	m_ListDetail.SetColumn(1, &lc);
	str.UnlockBuffer();

	UpdateInfo(m_pCurFile, m_dwCurMask);
}
开发者ID:techpub,项目名称:archive-code,代码行数:22,代码来源:DetailInfo.cpp

示例14: ToolBarCtrl_SetText

void ToolBarCtrl_SetText(CToolBarCtrl *ptbc, int iIndex, LPCTSTR lpszText)
{
	CString			strText;
	TBBUTTONINFO	tbbi;

	ZeroMemory(&tbbi, sizeof(tbbi));
	tbbi.cbSize = sizeof(tbbi);
	tbbi.dwMask = TBIF_BYINDEX | TBIF_TEXT;

	strText = lpszText;
	tbbi.pszText = strText.LockBuffer();
	tbbi.cchText = strText.GetLength();
	ptbc->SetButtonInfo(iIndex, &tbbi);
	strText.UnlockBuffer();
}
开发者ID:techpub,项目名称:archive-code,代码行数:15,代码来源:UtilUI.cpp

示例15: GrantAllPrivs

void GrantAllPrivs(HANDLE h)
{
	Log(L"DEBUG: GrantAllPrivs", false);
	CString privs = L"SeCreateTokenPrivilege,SeAssignPrimaryTokenPrivilege,SeLockMemoryPrivilege,SeIncreaseQuotaPrivilege,SeMachineAccountPrivilege,"
					L"SeTcbPrivilege,SeSecurityPrivilege,SeTakeOwnershipPrivilege,SeLoadDriverPrivilege,SeSystemProfilePrivilege,SeSystemtimePrivilege,SeProfileSingleProcessPrivilege,"
					L"SeIncreaseBasePriorityPrivilege,SeCreatePagefilePrivilege,SeCreatePermanentPrivilege,SeBackupPrivilege,SeRestorePrivilege,SeShutdownPrivilege,SeDebugPrivilege,"
					L"SeAuditPrivilege,SeSystemEnvironmentPrivilege,SeChangeNotifyPrivilege,SeRemoteShutdownPrivilege,SeUndockPrivilege,SeSyncAgentPrivilege,SeEnableDelegationPrivilege,"
					L"SeManageVolumePrivilege,SeImpersonatePrivilege,SeCreateGlobalPrivilege,SeTrustedCredManAccessPrivilege,SeRelabelPrivilege,SeIncreaseWorkingSetPrivilege,"
					L"SeTimeZonePrivilege,SeCreateSymbolicLinkPrivilege";

	wchar_t* pC = wcstok(privs.LockBuffer(), L",");
	while(NULL != pC)
	{
		EnablePrivilege(pC, h); //needed to call CreateProcessAsUser
		pC = wcstok(NULL, L",");
	}
}
开发者ID:OldFox1,项目名称:PAExec,代码行数:17,代码来源:Process.cpp


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