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


C++ A2W函数代码示例

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


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

示例1: TRACE

//{{VCI_IMPLEMENT_BEGIN
int CDuiPlugin::OnInit(UINT nIDTemplate, HWND hWnd, LPCSTR lpszName, CRect rc)
{
	// 调用DuiSystem创建一个Panel控件对象,并加载xml文件
	TRACE("CDuiPlugin::OnInit, name=%s, rc=%d,%d,%d,%d\n", lpszName, rc.left, rc.top, rc.right, rc.bottom);
	USES_CONVERSION;

	// 设置DuiVision库的根目录
	DuiSystem::SetRootPath(GetPlugInRootPath());

	// 初始化DUI库
	DWORD dwLangID = 0;
	new DuiSystem(NULL, dwLangID, _T(""), 1116, nIDTemplate, _T(""));

	DuiSystem::LogEvent(LOG_LEVEL_DEBUG, L"CDuiPlugin::OnInit root path is %s", GetPlugInRootPath());

	// 加载xml
	m_pDuiPanel = (CDuiPanel*)DuiSystem::CreateControlByName(L"div", hWnd, NULL);
	if(m_pDuiPanel)
	{
		// 给插件的panel对象注册事件处理对象
		CDuiHandlerPlugin* pHandler = new CDuiHandlerPlugin();
		pHandler->SetDuiPanel(m_pDuiPanel);
		DuiSystem::RegisterHandler(m_pDuiPanel, pHandler);
		// 加载插件界面文件
		BOOL bRet = m_pDuiPanel->LoadXmlFile(A2W(lpszName));
		DuiSystem::LogEvent(LOG_LEVEL_DEBUG, L"CDuiPlugin::OnInit load %s %s", A2W(lpszName), bRet ? L"succ" : L"fail");
	}

	return 0;
}
开发者ID:minyoad,项目名称:DuiVision,代码行数:31,代码来源:CDuiPlugin.cpp

示例2: cvGetModuleInfo

void CEyepatch::DisplayVersionInfo() {
	USES_CONVERSION;
	WCHAR versionInfo[1024];
    const char* opencv_libraries = 0;
    const char* addon_modules = 0;
    cvGetModuleInfo( 0, &opencv_libraries, &addon_modules );
	wsprintf(versionInfo, L"Eyepatch Version: %s\n", EYEPATCH_VERSION);
	wcscat(versionInfo, L"\nOpenCV Libraries: "); 
	wcscat(versionInfo, A2W(opencv_libraries)); 
	wcscat(versionInfo, L"\nAdd-On Modules: "); 
	wcscat(versionInfo, A2W(addon_modules));

	MSGBOXPARAMS mbp;
	mbp.hwndOwner = this->m_hWnd;
	mbp.hInstance = this->m_hInstance;
	mbp.dwStyle = MB_USERICON;
	mbp.lpszIcon = MAKEINTRESOURCE(IDI_EYEPATCH);
	mbp.dwContextHelpId = NULL;
	mbp.lpfnMsgBoxCallback = NULL;
	mbp.dwLanguageId = NULL;
	mbp.lpszCaption = L"Eyepatch Version Information";
	mbp.lpszText = versionInfo;

	::MessageBoxIndirect(&mbp);
}
开发者ID:gotomypc,项目名称:eyepatch,代码行数:25,代码来源:Eyepatch.cpp

示例3: ProcessHtml

void CFDMFlashVideoDownloads::ProcessHtml(LPCSTR pszHost, LPCSTR pszHtml)
{
	vmsVideoSiteHtmlCodeParser vshcp;
	if (FALSE == vshcp.Parse (pszHost, pszHtml))
		return;

	USES_CONVERSION;

	IWGUrlReceiverPtr spRcvr;
	spRcvr.CreateInstance (__uuidof (WGUrlReceiver));
	spRcvr->put_Url (A2W (vshcp.get_VideoUrl ()));

	if (vshcp.get_IsVideoUrlDirectLink ())
	{
		CString str = vshcp.get_VideoTitle ();
		str += "."; str += vshcp.get_VideoType ();
		spRcvr->put_FileName (A2W (str));

		spRcvr->put_Comment (A2W (vshcp.get_VideoTitle ()));

		spRcvr->put_FlashVideoDownload (TRUE);
	}

	spRcvr->AddDownload ();
}
开发者ID:HackLinux,项目名称:Free-Download-Manager-vs2010,代码行数:25,代码来源:FDMFlashVideoDownloads.cpp

示例4: _T

BOOL CxNetCardInfo::ParseData()
{
	USES_CONVERSION;

	macaddress.Format( _T("%02X:%02X:%02X:%02X:%02X:%02X"),pinfo->Address[0],pinfo->Address[1],pinfo->Address[2],pinfo->Address[3],pinfo->Address[4],pinfo->Address[5] );
	description = pinfo->Description;
	type.Format(_T("%d"),pinfo->Type);

	PIP_ADDR_STRING pAddressList = &(pinfo->IpAddressList);
	IpAddress = _T("");
	do {
		IpAddress += pAddressList->IpAddress.String;
		pAddressList = pAddressList->Next;
		if( pAddressList != NULL ) IpAddress += _T( "\r\n" );
	}while( pAddressList != NULL );

	subnet.Format( _T("%s"), A2W(pinfo->IpAddressList.IpMask.String) );
	gateway.Format( _T("%s"), A2W(pinfo->GatewayList.IpAddress.String) );
	if( pinfo->HaveWins ) 
		PrimaryWinsServer.Format( _T("%s"),pinfo->PrimaryWinsServer.IpAddress.String );
	else
		PrimaryWinsServer.Format( _T("%s"),_T("N/A") );
	if( pinfo->DhcpEnabled )
		dhcp.Format( _T("%s"),pinfo->DhcpServer.IpAddress.String );
	else
		dhcp.Format( _T("%s"),_T("N/A") );
	pinfo = pinfo->Next;
	
	return TRUE;
}
开发者ID:Hpark11,项目名称:FIES,代码行数:30,代码来源:xNetCardInfo.cpp

示例5: _tcscpy_s

void versionManager::getMainModuleVersion(VMMAPDEF& mapVersion)
{
	std::string   strVersion = "";
	TCHAR szBankPath[1000];

	_tcscpy_s(szBankPath, getModulePath().c_str());
	_tcscat_s(szBankPath, _T("\\MoneyHub.exe"));

	CFileVersionInfo vinfo;
	if (vinfo.Create(szBankPath))
	{
		tstring strFileVersion = vinfo.GetFileVersion();
		replace(strFileVersion.begin(), strFileVersion.end(), ',', '.');
		strFileVersion.erase(remove(strFileVersion.begin(), strFileVersion.end(), ' '), strFileVersion.end());
		strVersion = std::string(CT2A(strFileVersion.c_str(), 936));
	}
	else 
		return ;

	USES_CONVERSION;
	if(m_bEnName)
		mapVersion.insert(std::make_pair(L"Main",A2W(strVersion.c_str()) ) );
	else
	{
	    VMMAPDEF::iterator it = m_mapEnChName.find(L"Main");
		if( it != m_mapEnChName.end() )
			mapVersion.insert(std::make_pair(it->second.c_str(), A2W(strVersion.c_str()) ) );
	}
}
开发者ID:Williamzuckerberg,项目名称:chtmoneyhub,代码行数:29,代码来源:versionManager.cpp

示例6: DetourMessageBoxIndirectA

int WINAPI DetourMessageBoxIndirectA(const LPMSGBOXPARAMSA lpMsgBoxParams)
{
	USES_CONVERSION;
	wstring lpText = A2W(lpMsgBoxParams->lpszText);
	wstring lpCaption = A2W(lpMsgBoxParams->lpszCaption);
	
	return mhMessageBox(lpMsgBoxParams->hwndOwner, lpText.c_str(), lpCaption.c_str(), lpMsgBoxParams->dwStyle);
}
开发者ID:Williamzuckerberg,项目名称:chtmoneyhub,代码行数:8,代码来源:RegMonitor.cpp

示例7: _OnAlarm

static void CDECL _OnAlarm(int rank, ALARM_CLASS ac, const char * msg, PCRTK_ADDR src)
{
	if(!theDb){
		return;
	}
	USES_CONVERSION;
	theDb->Fire_OnAlarm(rank, ac, A2W(msg), A2W((char*)CHostName(src->host)));
}
开发者ID:eseawind,项目名称:CNCS_PMC-Conductor,代码行数:8,代码来源:pmcdb.cpp

示例8: CreateWindow

HWND Win32Tools::CreateWnd(HINSTANCE hinstance, char captain[])
{
	USES_CONVERSION;
	// Create the window
	return CreateWindow(A2W("MyWindowClass"), A2W(captain),
							  WS_OVERLAPPEDWINDOW,
							  CW_USEDEFAULT, CW_USEDEFAULT, 800, 800,
							  NULL, NULL, hinstance, NULL);
}
开发者ID:yotamgi,项目名称:ggchess,代码行数:9,代码来源:Win32Tools.cpp

示例9: GetModuleFileName

void MaxAWDExporter::CopyViewer(bool network)
{
    char awdDrive[4];
    char awdPath[1024];
    char awdName[256];
    char dleFullPath[1024];
    char dleDrive[4];
    char dlePath[1024];
    char tplHtmlPath[1024];
    char tplSwfPath[1024];
    char tplJsPath[1024];
    char outHtmlPath[1024];
    char outSwfPath[1024];
    char outJsPath[1024];

    // Get paths of plug-in DLE file and output AWD file and split into
    // components to be used to concatenate input and output paths.
    //TCHAR * dleFullPath_tchar=A2W(_T(""));
    TCHAR dleFullPath_tchar[1024];
    GetModuleFileName(hInstance, dleFullPath_tchar, 1024);
    char * dleFullPath_ptr=W2A(dleFullPath_tchar);
    _splitpath_s(dleFullPath_ptr, dleDrive, 4, dlePath, 1024, NULL, 0, NULL, 0);
    _splitpath_s(awdFullPath, awdDrive, 4, awdPath, 1024, awdName, 256, NULL, 0);
    // Select which viewer SWF file to copy depending on which sandbox
    // it should be compiled for (network or local.)
    char *viewerName = network?"AwayExtensions3dsMax\\AWDHTMLViewer\\viewer_n" : "AwayExtensions3dsMax\\AWDHTMLViewer\\viewer_l";

    // Assemble paths for inputs (templates)
    _makepath_s(tplHtmlPath, 1024, dleDrive, dlePath, "AwayExtensions3dsMax\\AWDHTMLViewer\\template", "html");
    _makepath_s(tplSwfPath, 1024, dleDrive, dlePath, viewerName, "swf");
    _makepath_s(tplJsPath, 1024, dleDrive, dlePath, "AwayExtensions3dsMax\\AWDHTMLViewer\\swfobject", "js");

    // Assemble paths for outputs
    _makepath_s(outHtmlPath, 1024, awdDrive, awdPath, awdName, "html");
    _makepath_s(outSwfPath, 1024, awdDrive, awdPath, "viewer", "swf");
    _makepath_s(outJsPath, 1024, awdDrive, awdPath, "swfobject", "js");

    // Copy HTML, and evaluate any variables in the template
    CopyViewerHTML(tplHtmlPath, outHtmlPath, awdName);

    // Copy SWF and JS files as-is
    TCHAR * tplSwfPath_tchar=A2W(tplSwfPath);
    TCHAR * outSwfPath_tchar=A2W(outSwfPath);
    TCHAR * tplJsPath_tchar=A2W(tplJsPath);
    TCHAR * outJsPath_tchar=A2W(outJsPath);
    CopyFile(tplSwfPath_tchar, outSwfPath_tchar, false);
    CopyFile(tplJsPath_tchar, outJsPath_tchar, true);

    TCHAR * outHtmlPath_tchar=A2W(outHtmlPath);
    ShellExecute(NULL, _T("open"), outHtmlPath_tchar, NULL, NULL, SW_SHOWNORMAL);
    free (tplSwfPath_tchar);
    free (outSwfPath_tchar);
    free (tplJsPath_tchar);
    free (outJsPath_tchar);
    free (dleFullPath_ptr);
    free (outHtmlPath_tchar);
}
开发者ID:quinsmpang,项目名称:Tools,代码行数:57,代码来源:maxawdexporter_helper.cpp

示例10: BuildFilterGraph

BOOL CVMR9Graph::BuildAndRenderGraph(bool withSound)
{
	USES_CONVERSION;

  int nLayer = 0;
  HRESULT hr;

	// ENSURE that a valid graph builder is available
	if (m_pGraphBuilder == NULL) {
		BOOL bRet = BuildFilterGraph(withSound);
		if (!bRet) return bRet;
	}

  // ENSURE that the filter graph is in a stop state
	OAFilterState filterState;
	m_pMediaControl->GetState(500, &filterState);
	if (filterState != State_Stopped) {
		m_pMediaControl->Stop();
	}

  	// CHECK a source filter availaibility for the layer
	if (m_srcFilterArray[nLayer] == NULL) {
		char pszFilterName[10];
		sprintf(pszFilterName, "SRC%02d", nLayer);
		IBaseFilter* pBaseFilter = NULL;
		hr = m_pGraphBuilder->AddSourceFilter(A2W(m_pszFileName), A2W(pszFilterName), &pBaseFilter);
		if (FAILED(hr)) {
			ReportError("Could not find a source filter for this file", hr);
			return FALSE;
		}
		m_srcFilterArray[nLayer] = pBaseFilter;
	} else {
		// suppress the old src filter
		IBaseFilter* pBaseFilter = m_srcFilterArray[nLayer];
		RemoveFilterChain(pBaseFilter, m_pVMRBaseFilter);
		pBaseFilter->Release();
		m_srcFilterArray[nLayer] = NULL;
		// create a new src filter
		char pszFilterName[10];
		sprintf(pszFilterName, "SRC%02d", nLayer);
		hr = m_pGraphBuilder->AddSourceFilter(A2W(m_pszFileName), A2W(pszFilterName), &pBaseFilter);
		m_srcFilterArray[nLayer] = pBaseFilter;
		if (FAILED(hr)) {
			m_srcFilterArray[nLayer] = NULL;
			ReportError("Could not load the file", hr);
			return FALSE;
		}
	}

	// RENDER the graph
	BOOL bRet = RenderGraph();
	if (!bRet) return bRet;

  return TRUE;
}
开发者ID:smarinel,项目名称:ags-web,代码行数:55,代码来源:acwavi3d.cpp

示例11: GetDbSchemeName

// *************************************************************
//		GerStyleTableName()
// *************************************************************
CStringW OgrStyleHelper::GetStyleTableName(CStringW layerName)
{
	CStringW name;
	USES_CONVERSION;
	if (m_globalSettings.useSchemesForStyles) {
		name.Format(L"%s%s", GetDbSchemeName(layerName, true), A2W(STYLES_TABLE_NAME));
	}
	else {
		name = A2W(STYLES_TABLE_NAME);
	}

	return name;
}
开发者ID:liuzhumei,项目名称:MapWinGIS,代码行数:16,代码来源:OgrStyle.cpp

示例12: A2W

bool CAddDevice::CheckONVIF()
{
	USES_CONVERSION;
	bool bResult = false;
	vector<NODEITEM> vcONVIFnode;
	vector<NODEITEM*> vcENCPnode;
	m_pbk->GetONVIFNodes(vcONVIFnode);
	vcENCPnode = CIPCamDiscovery::GetNodePtr();
	vector<CString> vcStrIP;
	vector<CString>::iterator it;
	CString str;
	int nIdx = 0, nCount = vcONVIFnode.size();
	for(nIdx = 0; nIdx < nCount; nIdx++)
	{
		str.Empty();
		str = A2W(vcONVIFnode[nIdx].ip);
		vcStrIP.push_back(str);
	}

	nCount = vcENCPnode.size();
	for(nIdx = 0; nIdx < nCount; nIdx++)
	{
		str.Empty();
		str = A2W(vcENCPnode[nIdx]->ip);
		it = find(vcStrIP.begin(),vcStrIP.end(),str);
		if (it != vcStrIP.end())
		{
			int nIdx = it-vcStrIP.begin();
			vcStrIP.erase(it);
			vcONVIFnode.erase(vcONVIFnode.begin()+nIdx);
		}
	}

	CString strAddress, strPort;
	GetKeyinAddress(strAddress, strPort);

	nCount = vcONVIFnode.size();
	for(nIdx = 0; nIdx < nCount; nIdx++)
	{
		str.Empty();
		str = A2W(vcONVIFnode[nIdx].ip);
		if (str == strAddress)
		{
			GetONVIF_RTSP(vcONVIFnode[nIdx].stream_url, m_strUserName, m_strPassword, vcONVIFnode[nIdx]);
			m_vcNodes.push_back(vcONVIFnode[nIdx]);
			bResult = true;
			break;
		}
	}
	return bResult;
}
开发者ID:YTYOON,项目名称:eNVR,代码行数:51,代码来源:AddDevice.cpp

示例13: ASSERT

ErrorCode HTMLIFrameElement::Load()
{
	ASSERT(0);
	return 0;
#if 0

	ASSERT(m_pFrameContent);

	sysstring src = get_src();

	if (src.Length())
	{
		TCHAR result[2048];
		{
			sysstring documentUrl = m_ownerDocument->get_url();

			DWORD resultLen = sizeof(result);
			InternetCombineUrl(W2A(documentUrl), W2A(src), result, &resultLen, 0);
		}

		CComBSTR url = A2W(result);

		return m_pFrameContent->LoadSRC(CComQIPtr<IHlinkSite>(m_ownerDocument), url);
	}
	else
		return S_FALSE;
#endif
}
开发者ID:sigurdle,项目名称:FirstProject2,代码行数:28,代码来源:HTMLIFrameElement.cpp

示例14: GetIfTable

NetUsage::NetUsage()
{
	m_OutLen = 0;
	GetIfTable(NULL, &m_OutLen, FALSE);
	m_OutBuf = new BYTE[m_OutLen];
	DWORD ret = GetIfTable((PMIB_IFTABLE)m_OutBuf, &m_OutLen, FALSE);
	USES_CONVERSION;
	if(ret == NO_ERROR)
	{
		MIB_IFTABLE *pIfTable = (MIB_IFTABLE *)m_OutBuf;
		for(DWORD a=0; a<pIfTable->dwNumEntries; a++)
		{
			MIB_IFROW & row = pIfTable->table[a];
			NetIf ni;
			ni.InSpeed = 0;
			ni.LastIn = row.dwInOctets;
			ni.LastOut = row.dwOutOctets;
			ni.Name = A2W((LPCSTR)row.bDescr);
			ni.OutSpeed = 0;
			m_IfRow.push_back(ni);

		}
		
	}
	SYSTEMTIME st;
	::GetLocalTime(&st);
	FILETIME ft;
	SystemTimeToFileTime(&st, &ft);
	//m_LastTime = time((time_t *)&m_LastTime);
	memcpy(&m_LastTime, &ft, sizeof(ULONGLONG));
}
开发者ID:bahamut8348,项目名称:xkcode,代码行数:31,代码来源:Utils.cpp

示例15: Error

STDMETHODIMP CISEMMManager::EnterOrder(ISEOrder* Order, BSTR* OrderID)
{
	USES_CONVERSION;

	if(!Order || !OrderID || !Order->Series)
		return E_POINTER;

	string sSeries = (char*)_bstr_t(Order->Series);
	if(sSeries.length() == 0)
		return Error(L"Invalid series name.");

	if(Order->Quantity <= 0)
		return Error(L"Invalid order quantity.");

	if(Order->Price <= 0)
		return Error(L"Invalid order price.");

	if(Order->BidOrAsk == enBoth)
		return Error(L"Order may only be of Ask or Bid type.");

	string sOrderID;

	HRESULT hr = theISEManager->EnterOrder(sSeries, Order->Quantity, 
		Order->Price, Order->BidOrAsk, sOrderID);

	if(SUCCEEDED(hr))
		*OrderID = SysAllocString(A2W(sOrderID.c_str()));

	return hr;
}
开发者ID:AlexS2172,项目名称:IVRM,代码行数:30,代码来源:isemmmanager.cpp


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