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


C++ CStringW函数代码示例

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


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

示例1: BeginEnumSysDev

HRESULT CFGManagerBDA::CreateKSFilter(IBaseFilter** ppBF, CLSID KSCategory, CStringW& DisplayName)
{
	HRESULT		hr = VFW_E_NOT_FOUND;
	BeginEnumSysDev (KSCategory, pMoniker) {
		CComPtr<IPropertyBag>	pPB;
		CComVariant				var;
		LPOLESTR				strName = NULL;
		if (SUCCEEDED (pMoniker->BindToStorage(0, 0, IID_IPropertyBag, (void**)&pPB)) &&
				SUCCEEDED (pMoniker->GetDisplayName(NULL, NULL, &strName)) &&
				SUCCEEDED (pPB->Read(CComBSTR(_T("FriendlyName")), &var, NULL)) ) {
			CStringW	Name = CStringW(strName);
			if (Name != DisplayName) {
				continue;
			}

			hr = pMoniker->BindToObject(NULL, NULL, IID_IBaseFilter, (void**)ppBF);
			if (SUCCEEDED (hr)) {
				hr = AddFilter (*ppBF, CStringW(var.bstrVal));
			}
			break;
		}

		if (strName) {
			CoTaskMemFree(strName);
		}
	}
开发者ID:Samangan,项目名称:mpc-hc,代码行数:26,代码来源:FGManagerBDA.cpp

示例2: CStringW

CStringW CComboBoxEx::GetItemTextW(int nItem) const
{
	if (IsUnicodeSystem())
	{
		COMBOBOXEXITEMW ce;
		WCHAR szBuffer[2000];
		ce.iItem=nItem;
		ce.cchTextMax=2000;
		ce.pszText=szBuffer;
		ce.mask=CBEIF_TEXT;
		if (::SendMessageW(CCommonCtrl::m_hWnd,CBEM_GETITEMW,0,(LPARAM)&ce))
			return CStringW(szBuffer);
	}
	else
	{
		COMBOBOXEXITEM ce;
		char szBuffer[2000];
		ce.iItem=nItem;
		ce.cchTextMax=2000;
		ce.pszText=szBuffer;
		ce.mask=CBEIF_TEXT;
		if (::SendMessageA(CCommonCtrl::m_hWnd,CBEM_GETITEMA,0,(LPARAM)&ce))
			return CStringW(szBuffer);
	}
	return CStringW();
}
开发者ID:joshball,项目名称:locate32-cogit.net,代码行数:26,代码来源:CommonControls.cpp

示例3: GetMime

void CFormData::AddFile(LPCTSTR __szField, LPCTSTR __szFilename, LPCTSTR __szMime)
{
	CFormItem *attr = NULL;

	CStringW sMime = __szMime;
	// Se o mime for null, vamos tentar determinar...
	if(__szMime == NULL)
	{
		CStringW s1 = __szFilename;
		int pos = 0;
		if((pos = s1.ReverseFind('.')) > 0)
			s1 = s1.Right(s1.GetLength()-pos-1);
		sMime = GetMime(s1);
	}

	// Verificar se ja foi incluido...
	if(!m_items.Lookup(CStringW(__szField).MakeLower(), attr))
		attr = new CFormItem(__szField, __szFilename, sMime);
	else
	{
		// Se sim, vamos atualizar o item...
		attr->m_value = __szFilename;
		attr->m_mime  = sMime;
	}

	m_items.SetAt(CStringW(__szField).MakeLower(), attr);
}
开发者ID:MFDonadeli,项目名称:PMA,代码行数:27,代码来源:FormData.cpp

示例4: while

void CWAVFile::SetProperties(IBaseFilter* pBF)
{
	if (m_info.GetCount() > 0) {
		if (CComQIPtr<IDSMPropertyBag> pPB = pBF) {
			POSITION pos = m_info.GetStartPosition();
			while (pos) {
				DWORD fcc;
				CStringA value;
				m_info.GetNextAssoc(pos, fcc, value);

				switch (fcc) {
				case FCC('INAM'):
					pPB->SetProperty(L"TITL", CStringW(value));
					break;
				case FCC('IART'):
					pPB->SetProperty(L"AUTH", CStringW(value));
					break;
				case FCC('ICOP'):
					pPB->SetProperty(L"CPYR", CStringW(value));
					break;
				case FCC('ISBJ'):
					pPB->SetProperty(L"DESC", CStringW(value));
					break;
				}
			}
		}
	}
}
开发者ID:Tphive,项目名称:mpc-be,代码行数:28,代码来源:WAVFile.cpp

示例5: ReadUInt16

CStringW CFileDataIO::ReadStringUTF8()
{
	UINT uRawSize = ReadUInt16();
	const UINT uMaxShortRawSize = SHORT_RAW_ED2K_UTF8_STR;
	if (uRawSize <= uMaxShortRawSize)
	{
		char acRaw[uMaxShortRawSize];
		Read(acRaw, uRawSize);
		WCHAR awc[uMaxShortRawSize];
		int iChars = ByteStreamToWideChar(acRaw, uRawSize, awc, ARRSIZE(awc));
		if (iChars >= 0)
			return CStringW(awc, iChars);
		return CStringW(acRaw, uRawSize); // use local codepage
	}
	else
	{
		Array<char> acRaw(uRawSize);
		Read(acRaw, uRawSize);
		Array<WCHAR> awc(uRawSize);
		int iChars = ByteStreamToWideChar(acRaw, uRawSize, awc, uRawSize);
		if (iChars >= 0)
			return CStringW(awc, iChars);
		return CStringW(acRaw, uRawSize); // use local codepage;
	}
}
开发者ID:litaobj,项目名称:easymule,代码行数:25,代码来源:SafeFile.cpp

示例6: ReadMemoryStringW

CStringW ReadMemoryStringW( size_t address, SIZE_T max )
{
	auto buffer = std::make_unique<wchar_t[ ]>( max + 1 );
	SIZE_T bytesRead;

	if ( ReadMemory( (PVOID) address, buffer.get( ), max * sizeof( wchar_t ), &bytesRead ) != 0 )
	{
		bytesRead /= sizeof( wchar_t );
		
		for ( int i = 0; i < bytesRead; i++ )
		{
			if ( !( iswprint( buffer[ i ] ) ) && buffer[ i ] != '\0' )
				buffer[ i ] = '.';
		}
		
		buffer[ bytesRead ] = '\0';

		return CStringW( buffer.get( ) );
	} else {
#ifdef _DEBUG
		PrintOut( _T( "[ReadMemoryString]: Failed to read memory, GetLastError() = %s" ), Utils::GetLastErrorString( ).GetString( ) );
#endif
		return CStringW( L".." );
	}
}
开发者ID:ChunHungLiu,项目名称:Reclass-2015,代码行数:25,代码来源:stdafx.cpp

示例7: path

void CConvertDlg::AddFile(CString fn)
{
	CString protocol;

	int i = fn.Find(_T("://"));
	if(i > 0)
	{
		CString url = fn.Mid(i);
		CPath path(fn.Left(i));
		path.StripPath();
		protocol = (LPCTSTR)path;
		fn = (LPCTSTR)path + url;
	}

	CComPtr<IBaseFilter> pBF;
	if(FAILED(m_pGB->AddSourceFilter(CStringW(fn), CStringW(fn), &pBF)))
		return;

	int nConnected = 0;
	BeginEnumPins(pBF, pEP, pPin)
	if(S_OK == m_pGB->ConnectFilter(pPin, m_pMux)) nConnected++;
	EndEnumPins;
	if(!nConnected)
	{
		MessageBeep((UINT)-1);
		DeleteFilter(pBF);
		return;
	}

	if(m_tree.GetCount() == 0)
	{
		if(CComQIPtr<IDSMPropertyBag> pPB = m_pMux)
			pPB->DelAllProperties();

		CString ext(_T(".dsm"));

		if(!protocol.IsEmpty())
		{
			m_fn = protocol + ext;
		}
		else
		{
			CPath p(fn);
			if(ext.CompareNoCase(p.GetExtension()) == 0)
				ext = _T(" (remuxed)") + ext;
			p.RemoveExtension();
			m_fn = (LPCTSTR)p + ext;
		}

		UpdateData(FALSE);
	}

	CTreeItemFile* t = DNew CTreeItemFile(fn, pBF, m_tree, NULL);

	AddFilter(*t, pBF);

	m_tree.Expand(*t, TVE_EXPAND);
	m_tree.EnsureVisible(*t);
}
开发者ID:Fluffiest,项目名称:mpc-hc,代码行数:59,代码来源:ConvertDlg.cpp

示例8: return

bool CmbFileFind::IsDots()
{
	if (m_foundInfo != 0)
	{
		return (((CStringW)(m_foundInfo->cFileName)).CompareNoCase(CStringW(".")) == 0 
			|| ((CStringW)(m_foundInfo->cFileName)).CompareNoCase(CStringW("..")) == 0);
	}
	return false;
}
开发者ID:gitsly,项目名称:CodingSandbox,代码行数:9,代码来源:CmbFileFind.cpp

示例9: WideCharToMultiByte

char*CMt5Client::UnicodeToUTF_8First(CString str)
{
	//mid 将UNICODE的CString转换为utf8字符串返回,在此处使用的是堆内存分配,所以,接受者在使用完结果后需要手动释放内存,以防溢出
	int u8Len = WideCharToMultiByte(CP_UTF8, NULL, CStringW(str), str.GetLength(), NULL, 0, NULL, NULL);
	char* szU8 = new  char[u8Len + 1];
	WideCharToMultiByte(CP_UTF8, NULL, CStringW(str), str.GetLength(), szU8, u8Len, NULL, NULL);
	szU8[u8Len] = '\0';
	return szU8;
}
开发者ID:UpSea,项目名称:midProjects,代码行数:9,代码来源:Mt5Client.cpp

示例10: CFormItem

void CFormData::AddItem(LPCTSTR __szField, LPCTSTR __szValue)
{
	CFormItem *attr = NULL;

	// Verifica se ja foi inserido...
	if(!m_items.Lookup(CStringW(__szField).MakeLower(), attr))
		attr = new CFormItem(__szField, __szValue);
	else
		attr->m_value = __szValue; // Atualiza...

	m_items.SetAt(CStringW(__szField).MakeLower(), attr);
}
开发者ID:MFDonadeli,项目名称:PMA,代码行数:12,代码来源:FormData.cpp

示例11: while

void Skein::Import(const char* path)
{
  Node* node = m_inst.root;
  bool added = false;

  CStdioFile recFile;
  if (recFile.Open(path,CFile::modeRead|CFile::typeText))
  {
    CString recLine;
    while (recFile.ReadString(recLine))
    {
      recLine.Trim();
      if (recLine.GetLength() > 0)
      {
        CStringW recLineW = EscapeLine(CStringW(recLine),UsePrintable);
        Node* newNode = node->Find(recLineW);
        if (newNode == NULL)
        {
          newNode = new Node(recLineW,L"",L"",L"",false);
          node->Add(newNode);
          added = true;
        }
        node = newNode;
      }
    }

    if (added)
    {
      m_layout = false;
      NotifyChange(TreeChanged);
      NotifyEdit(true);
    }
  }
}
开发者ID:DavidKinder,项目名称:Windows-Inform7,代码行数:34,代码来源:Skein.cpp

示例12: getPropertyValue

bool getPropertyValue(CComPtr<IDispatchEx> object, DISPID dispId, VARIANT& result)
{
	// Invoke the property get to get the property's value.
	//
	DISPPARAMS params;
	memset(&params, 0, sizeof(DISPPARAMS));
	VariantInit(&result);

	BSTR memberName = NULL;
	if (SUCCEEDED(object->GetMemberName(dispId, &memberName))) {
		// BEGIN HARDCODE - Accessing the "filters" property (for example, from Google Maps)
		// causes crashes access violations deep in MSHTML.
		//
		bool skip = CStringW(memberName).Compare(L"filters") == 0;
		SysFreeString(memberName);
		if (skip)
			return false;
		// END HARDCODE
	}

	if (SUCCEEDED(object->Invoke(dispId, IID_NULL, LOCALE_SYSTEM_DEFAULT, DISPATCH_PROPERTYGET,
		&params, &result, NULL, NULL))) {
		return true;
	}
	else {
		return false;
	}
}
开发者ID:ShiningBrightly,项目名称:ieleak,代码行数:28,代码来源:PropDlg.cpp

示例13: ASSERT

LRESULT COleIPFrameWnd::OnSetMessageString(WPARAM wParam, LPARAM lParam)
{
	if (m_lpFrame != NULL)
	{
		LPCTSTR lpsz = NULL;
		CString strMessage;

		// set the message bar text
		if (lParam != NULL)
		{
			ASSERT(wParam == 0);    // can't have both an ID and a string
			lpsz = (LPCTSTR)lParam; // set an explicit string
		}
		else if (wParam != 0)
		{
			// get message associated with the ID indicated by wParam
			GetMessageString((UINT)wParam, strMessage);
			lpsz = strMessage;
		}

		// notify container of new status text
		if (lpsz == NULL)
			lpsz = _T("");
		m_lpFrame->SetStatusText(CStringW(lpsz).GetString());
	}

	UINT nIDLast = m_nIDLastMessage;
	m_nIDLastMessage = (UINT)wParam;    // new ID (or 0)
	m_nIDTracking = (UINT)wParam;       // so F1 on toolbar buttons work
	return nIDLast;
}
开发者ID:jbeaurain,项目名称:omaha_vs2010,代码行数:31,代码来源:oleipfrm.cpp

示例14: CStringW

	FontWrapper* FontCache::Create(HDC hDC, const LOGFONT& lf)
	{
		CStringW key;

		key.Format(L"%s,%d,%d,%d",
				   CStringW(lf.lfFaceName), lf.lfHeight, lf.lfWeight,
				   ((lf.lfItalic&1)<<2) | ((lf.lfUnderline&1)<<1) | ((lf.lfStrikeOut&1)<<0));

		FontWrapper* pFW = NULL;

		if(m_key2obj.Lookup(key, pFW)) {
			return pFW;
		}

		HFONT hFont = CreateFontIndirect(&lf);

		if(!hFont) {
			ASSERT(0);
			return NULL;
		}

		pFW = DNew FontWrapper(hDC, hFont, key);

		Add(key, pFW, false);

		return pFW;
	}
开发者ID:DieBagger,项目名称:MediaPortal-1,代码行数:27,代码来源:Renderer.cpp

示例15: entryA

CStringW InformApp::GetProfileString(LPCSTR section, LPCWSTR entry, LPCWSTR defaultValue)
{
  if (theOS.IsWindows9X())
  {
    CString entryA(entry), defaultValueA(defaultValue);
    return CStringW(CWinApp::GetProfileString(section,entryA,defaultValueA));
  }

  if (m_pszRegistryKey == NULL)
    return defaultValue;
  HKEY secKey = GetSectionKey(section);
  if (secKey == NULL)
    return defaultValue;

  CStringW value;
  DWORD type, count;
  LONG result = ::RegQueryValueExW(secKey,entry,NULL,&type,NULL,&count);
  if (result == ERROR_SUCCESS)
  {
    result = ::RegQueryValueExW(secKey,entry,NULL,&type,
      (LPBYTE)value.GetBuffer(count/sizeof(WCHAR)),&count);
    value.ReleaseBuffer();
  }
  ::RegCloseKey(secKey);
  if (result == ERROR_SUCCESS)
    return value;
  return defaultValue;
}
开发者ID:wyrover,项目名称:Windows-Inform7,代码行数:28,代码来源:Inform.cpp


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