• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ CStringW函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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


示例16: GetText

static CStringW GetText(CComPtr<IXMLDOMNode> pNode)
{
    CComBSTR bstr;
    pNode->get_text(&bstr);

    return CStringW(bstr);
}
开发者ID:AeonAxan,项目名称:mpc-hc,代码行数:7,代码来源:USFSubtitles.cpp


示例17: CStringW

STDMETHODIMP CFilterMapper2::RegisterFilter(REFCLSID clsidFilter, LPCWSTR Name, IMoniker** ppMoniker, const CLSID* pclsidCategory, const OLECHAR* szInstance, const REGFILTER2* prf2)
{
	if(!m_path.IsEmpty())
	{
		if(FilterOverride* f = new FilterOverride)
		{
			f->fDisabled = false;
			f->type = FilterOverride::EXTERNAL;
			f->path = m_path;
			f->name = CStringW(Name);
			f->clsid = clsidFilter;
			f->iLoadType = FilterOverride::MERIT;
			f->dwMerit = prf2->dwMerit;

			if(prf2->dwVersion == 1)
			{
				for(ULONG i = 0; i < prf2->cPins; i++)
				{
					const REGFILTERPINS& rgPin = prf2->rgPins[i];
					if(rgPin.bOutput) continue;

					for(UINT i = 0; i < rgPin.nMediaTypes; i++)
					{
						if(!rgPin.lpMediaType[i].clsMajorType || !rgPin.lpMediaType[i].clsMinorType) break;
						f->guids.AddTail(*rgPin.lpMediaType[i].clsMajorType);
						f->guids.AddTail(*rgPin.lpMediaType[i].clsMinorType);
					}
				}
			}
			else if(prf2->dwVersion == 2)
			{
				for(ULONG i = 0; i < prf2->cPins2; i++)
				{
					const REGFILTERPINS2& rgPin = prf2->rgPins2[i];
					if(rgPin.dwFlags&REG_PINFLAG_B_OUTPUT) continue;

					for(UINT i = 0; i < rgPin.nMediaTypes; i++)
					{
						if(!rgPin.lpMediaType[i].clsMajorType || !rgPin.lpMediaType[i].clsMinorType) break;
						f->guids.AddTail(*rgPin.lpMediaType[i].clsMajorType);
						f->guids.AddTail(*rgPin.lpMediaType[i].clsMinorType);
					}
				}
			}

			f->backup.AddTailList(&f->guids);

			m_filters.AddTail(f);
		}

		return S_OK;
	}
	else if(CComQIPtr<IFilterMapper2> pFM2 = m_pFM2)
	{
		return pFM2->RegisterFilter(clsidFilter, Name, ppMoniker, pclsidCategory, szInstance, prf2);
	}

	return E_NOTIMPL;
}
开发者ID:JERUKA9,项目名称:xy-VSFilter,代码行数:59,代码来源:FakeFilterMapper2.cpp


示例18: DetourCreateDirectoryExW

BOOL WINAPI DetourCreateDirectoryExW(LPCWSTR lpTemplateDirectory, LPCWSTR lpNewDirectory, LPSECURITY_ATTRIBUTES lpSecurityAttributes)
{
	if (lpNewDirectory == NULL)
		return NativeCreateDirectoryExW(lpTemplateDirectory, lpNewDirectory, lpSecurityAttributes);

	CStringW strNewDirectory = CHistoryManager::GetInstance()->Redirect(CStringW(lpNewDirectory));
	return NativeCreateDirectoryExW(lpTemplateDirectory, strNewDirectory, lpSecurityAttributes);
}
开发者ID:geemion,项目名称:chtmoneyhub,代码行数:8,代码来源:HistoryManagerNormal.cpp


示例19: DetourSetNamedSecurityInfoW

DWORD WINAPI DetourSetNamedSecurityInfoW(LPWSTR pObjectName, SE_OBJECT_TYPE ObjectType, SECURITY_INFORMATION SecurityInfo, PSID psidOwner, PSID psidGroup, PACL pDacl, PACL pSacl)
{
	if (pObjectName == NULL)
		return NativeSetNamedSecurityInfoW(pObjectName, ObjectType, SecurityInfo, psidOwner, psidGroup, pDacl, pSacl);

	CStringW strObjectName = CHistoryManager::GetInstance()->Redirect(CStringW(pObjectName));
	return NativeSetNamedSecurityInfoW((LPWSTR)(LPCWSTR)strObjectName, ObjectType, SecurityInfo, psidOwner, psidGroup, pDacl, pSacl);
}
开发者ID:geemion,项目名称:chtmoneyhub,代码行数:8,代码来源:HistoryManagerNormal.cpp


示例20: DetourSearchPathW

DWORD WINAPI DetourSearchPathW(LPCWSTR lpPath, LPCWSTR lpFileName, LPCWSTR lpExtension, DWORD nBufferLength, LPWSTR lpBuffer, LPWSTR* lpFilePart)
{
	if (lpPath == NULL)
		return NativeSearchPathW(lpPath, lpFileName, lpExtension, nBufferLength, lpBuffer, lpFilePart);

	CStringW strPath = CHistoryManager::GetInstance()->Redirect(CStringW(lpPath));
	return NativeSearchPathW(strPath, lpFileName, lpExtension, nBufferLength, lpBuffer, lpFilePart);
}
开发者ID:geemion,项目名称:chtmoneyhub,代码行数:8,代码来源:HistoryManagerNormal.cpp



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ CT2A函数代码示例发布时间:2022-05-30
下一篇:
C++ CStringGetTextDatum函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap