當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。