您当前的位置:首页 > IT编程 > C++
| C语言 | Java | VB | VC | python | Android | TensorFlow | C++ | oracle | 学术与代码 | cnn卷积神经网络 | gnn | 图像修复 | Keras | 数据集 | Neo4j | 自然语言处理 | 深度学习 | 医学CAD | 医学影像 | 超参数 | pointnet | pytorch | 异常检测 | Transformers | 情感分类 | 知识图谱 |

自学教程:C++ CA2W函数代码示例

51自学网 2021-06-01 19:56:18
  C++
这篇教程C++ CA2W函数代码示例写得很实用,希望能帮到您。

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

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

示例1: GetBody

void CCommandProcessor::OnPingClientResp(BYTE *pBuffer, size_t bufLen){	PINGCLIENTRESP pcr = {0};	GetBody(pBuffer, &pcr, sizeof PINGCLIENTRESP);	CString strTermID = CA2W(pcr.termId);	CString strIP = CA2W(pcr.termIp);	INT_PTR nIndex = m_lpLocalServer->ComputerList.Find(strTermID, strIP);	if (nIndex >= 0)	{		CComputerInfo& computer = m_lpLocalServer->ComputerList.GetComputer(nIndex);		if (computer.GetComputerStatus() == CComputerInfo::ECS_THIEF)		{			if (0 == pcr.cCode) //不通			{				computer.SetComputerStatus(CComputerInfo::ECS_OFFLINE);			}		}		else if (computer.GetComputerStatus() == CComputerInfo::ECS_OFFLINE)		{			if (1 == pcr.cCode) //通			{				computer.SetComputerStatus(CComputerInfo::ECS_THIEF);			}		}		m_lpLocalServer->ComputerList.UpdateComputer(nIndex, computer);		m_lpLocalServer->GetComputerListView()->Refresh(FALSE);	}}
开发者ID:layerfsd,项目名称:PersonalIBA,代码行数:33,


示例2: EncConverterConvertStringA

ECDRIVER_API HRESULT EncConverterConvertStringA(LPCSTR lpszConverterName, LPCSTR lpszInput, LPSTR lpszOutput, int nOutputLen){    CStringW strConverterName = CA2W(lpszConverterName, 65001);    CSilEncConverter* pEC = GetEncConverter(strConverterName);	if (!(*pEC))		pEC->Initialize(pEC->ConverterName, pEC->DirectionForward, pEC->NormalizeOutput);	if (!(*pEC))		return /*NameNotFound*/ -7;	int nCodePage = (pEC->IsInputLegacy()) ? pEC->CodePageInput() : /* UTF8 */ 65001;	// EncConverter's interface is easiest when wide	CStringW strInput = CA2W(lpszInput, nCodePage);	CStringW strOutputW;    HRESULT hr = pEC->Convert(strInput, strOutputW);    if (hr < 0)        return hr;	nCodePage = (pEC->IsOutputLegacy()) ? pEC->CodePageOutput() : /* UTF8 */ 65001;	CStringA strOutput = CW2A(strOutputW, nCodePage);	strncpy(lpszOutput, (LPCSTR)strOutput, nOutputLen);	return S_OK;}
开发者ID:bobeaton,项目名称:ec-main,代码行数:27,


示例3: GetWindowRect

/*** FUNCTION OnInitDialog** @brief ** @version 1.0 ** @author David Libby* @date 8/2/2013 11:38:34 AM** @param uMsg * @param wParam * @param lParam * @param bHandled ** @return LRESULT */LRESULT LaserStatusDialog::OnInitDialog(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled){	//SetWindowPos(HWND_TOPMOST,0,0,0,0,SWP_NOMOVE|SWP_NOSIZE);	GetWindowRect(&m_LargeRect);	m_SmallRect=m_LargeRect;	m_SmallRect.right-=SHRINK_SIZE;	SetWindowSmall();	GetDlgItem(IDC_STATIC_TEMP).GetClientRect(&m_StaticTempRectangle);	GetDlgItem(IDC_STATIC_TEMP).MapWindowPoints(this->m_hWnd,(LPPOINT)&m_StaticTempRectangle,2);	GetDlgItem(IDC_STATIC_LASER_STATUS).GetClientRect(&m_StaticLaserStatusRectangle);	GetDlgItem(IDC_STATIC_LASER_STATUS).MapWindowPoints(this->m_hWnd,(LPPOINT)&m_StaticLaserStatusRectangle,2);	m_Button_Start_Stop=GetDlgItem(ID_START_STOP);	SetStartStopStatusText();	//Prep out degrees per Pix	int recHeight=m_StaticTempRectangle.bottom-m_StaticTempRectangle.top;	double temprange = TOP_TEMP_C - BOTTOM_TEMP_C;	m_dDegreesCPerPix = (double)recHeight/temprange;	std::string WindowText="Laser Dialog ( 488 nm )";	this->SetWindowTextW(CA2W(WindowText.c_str()).m_szBuffer);	//HFONT MyOldTextFont = GetDlgItem(IDC_STATIC_LASER_NM).GetFont();	//LOGFONT MyNewFontFont;	//GetObject ( MyOldTextFont, sizeof(LOGFONT), &MyNewFontFont );	//MyNewFontFont.lfHeight = 24 ;                    // request a 12-pixel-height font	//_tcsncpy_s(MyNewFontFont.lfFaceName, LF_FACESIZE,  _T("Arial"), 7);	//HFONT hCustomFont = CreateFontIndirect ( &MyNewFontFont );	std::string Power_mW="50";	m_Edit_Power=GetDlgItem(IDC_EDIT_POWER_MW);	m_Edit_Power.SetWindowTextW(CA2W(Power_mW.c_str()).m_szBuffer);	//GetDlgItem(IDC_STATIC_LASER_NM).SetFont(hCustomFont);	if(m_OnTop)	{		SetWindowPos(HWND_TOPMOST,0,0,0,0,SWP_NOMOVE|SWP_NOSIZE);	}else	{				SetWindowPos(HWND_BOTTOM,0,0,0,0,SWP_NOMOVE|SWP_NOSIZE);	}			//::SetForegroundWindow(GetDlgItem(IDD_DIALOG_PROGRESS));			::SetWindowPos(this->m_hWnd,HWND_TOPMOST,0,0,0,0,SWP_SHOWWINDOW|SWP_NOSIZE|SWP_NOMOVE);	return 1;};
开发者ID:davidlibbyFIT,项目名称:Libby,代码行数:75,


示例4: UpdateData

void CFoosballDlg::OnTimer(UINT_PTR nIDEvent){	char Count[32];	UpdateData(TRUE);				// get tthe latest m_PositionSelection value	GetEncoderCount(m_PositionSelection, MOVE_MOTOR, Count);	SetDlgItemText(IDC_STATIC_MOVE_COUNT, CA2W(Count));	GetEncoderCount(m_PositionSelection, KICK_MOTOR, Count);	SetDlgItemText(IDC_STATIC_KICK_COUNT, CA2W(Count));	__super::OnTimer(nIDEvent);}
开发者ID:tsimons89,项目名称:foosballW16,代码行数:10,


示例5: GetObject

void LaserStatusDialog::DrawTempatureScaleText(HDC &hdc,RECT DrawArea,std::string TempString){		//DrawArea.top-=19;	HFONT hFont, hOldFont; 	// Retrieve a handle to the variable stock font.  	hFont = (HFONT)GetStockObject(DEFAULT_GUI_FONT); 	LOGFONT LargeFont,SmallFont;	GetObject ( hFont, sizeof(LOGFONT), &LargeFont );	LargeFont.lfHeight = 20 ;                    // request a 12-pixel-height font	_tcsncpy_s(LargeFont.lfFaceName, LF_FACESIZE,  _T("Arial"), 7);	SmallFont=LargeFont;		HFONT hCustomLargeFont = CreateFontIndirect ( &LargeFont );	HFONT hCustomSmallFont = CreateFontIndirect ( &SmallFont );	int gray=110;	COLORREF OldCOlor = SetTextColor(hdc, RGB(gray,gray,gray));		hOldFont = (HFONT)SelectObject(hdc, hCustomLargeFont);	//Build a 1 pix Gray border by drawing the text sihfted in all 4 directions 	int oldCkgroundMode = SetBkMode(hdc, TRANSPARENT);	int pixAtound =1;	DrawArea.top-=pixAtound;	DrawText(hdc,CA2W(TempString.c_str()).m_szBuffer,TempString.size(),&DrawArea,DT_CENTER);	DrawArea.top+=pixAtound;	DrawArea.left-=pixAtound;	DrawText(hdc,CA2W(TempString.c_str()).m_szBuffer,TempString.size(),&DrawArea,DT_CENTER);	DrawArea.bottom+=pixAtound;	DrawArea.left+=pixAtound;	DrawText(hdc,CA2W(TempString.c_str()).m_szBuffer,TempString.size(),&DrawArea,DT_CENTER);	DrawArea.bottom-=pixAtound;	DrawArea.right+=pixAtound;	DrawText(hdc,CA2W(TempString.c_str()).m_szBuffer,TempString.size(),&DrawArea,DT_CENTER);		DrawArea.right-=pixAtound;		//Now draw the font black Centered.	SetTextColor(hdc, RGB(0,0,0));	SelectObject(hdc, hCustomSmallFont);	DrawText(hdc,CA2W(TempString.c_str()).m_szBuffer,TempString.size(),&DrawArea,DT_CENTER);	SetBkMode(hdc, oldCkgroundMode  );	// Restore the original font.        	SelectObject(hdc, hOldFont); 	// Restore the original Color.        	SetTextColor(hdc, OldCOlor);}
开发者ID:davidlibbyFIT,项目名称:Libby,代码行数:55,


示例6: SetIcon

BOOL CFoosballDlg::OnInitDialog(){	CDialogEx::OnInitDialog();	// Set the icon for this dialog.  The framework does this automatically	//  when the application's main window is not a dialog	SetIcon(m_hIcon, TRUE);			// Set big icon	SetIcon(m_hIcon, FALSE);		// Set small icon	VERIFY(m_Exit.AutoLoad(IDEXIT, this));	WINDOWPLACEMENT lpwndpl;	GetWindowPlacement(&lpwndpl);	MainWnd = this;	ImageDC = GetDlgItem(IDC_DISPLAY)->GetDC();	ParentWnd = GetDlgItem(IDC_DISPLAY);	ParentWnd->GetWindowPlacement(&lpwndpl);	ImageRect = lpwndpl.rcNormalPosition;	// initialization must be done in this order.  cannot be changed	Init(); 	m_ColorTool.ColorToolInit(ParentWnd->GetDC(), ImageRect, DigSizeX, DigSizeY);	ReadSysConfiguration();	SetFieldPlayerMask();	ConnectToControllers();	for (int i = 0; i < ROWS_PLAYER; i++) {		GetDlgItem(IDC_FORWARD + i)->EnableWindow(Device[DeviceMap[i]].IsConnected());	}	char Str[8];	m_SliderMove.SetRange(-1000, 1000, TRUE);	m_SliderKick.SetRange(-1000, 1000, TRUE);	m_SliderPlayer.SetRange(0, 255, TRUE);	m_SliderBall.SetRange(0, 255, TRUE);	m_SliderMove.SetPos(0);	sprintf_s(Str, "%d", 0);	SetDlgItemText(IDC_STATIC_MOVE, CA2W(Str));	m_SliderKick.SetPos(0);	sprintf_s(Str, "%d", 0);	SetDlgItemText(IDC_STATIC_KICK, CA2W(Str));	m_SliderPlayer.SetPos(SC.PlayerThreshold); sprintf_s(Str, "%d", SC.PlayerThreshold);	SetDlgItemText(IDC_STATIC_PLAYER, CA2W(Str));	m_SliderBall.SetPos(SC.BallThreshold); sprintf_s(Str, "%d", SC.BallThreshold);	SetDlgItemText(IDC_STATIC_BALL, CA2W(Str));	m_UpdateImage = UpdateImage;	m_UpdateGraphics = UpdateGraphics;	m_DisplaySelection = DisplaySelection;	m_Acquisition = Acquisition;	// only for testing	m_PositionSelection = BACKFIELD_ROW;	m_MoveMotorMode = MotorMode[MOVE_MOTOR][m_PositionSelection];	m_KickMotorMode = MotorMode[KICK_MOTOR][m_PositionSelection];	UpdateData(FALSE);	SetTimer(0, 200, NULL);		// Run timer to update encoder count	return TRUE;  // return TRUE  unless you set the focus to a control}
开发者ID:tsimons89,项目名称:foosballW16,代码行数:52,


示例7: sprintf_s

void CFoosballDlg::OnBnClickedSaveImage(){//	OnBnClickedStop();	char	DirectoryName[128];	char	Filter[128];	sprintf_s(Filter, "Bitmap Image (*.bmp)|*.bmp|| | TIFF Document (*.tif)|*.tif");	sprintf_s(DirectoryName, "%sImages//*.bmp", APP_DIRECTORY);	CFileDialog dlg(FALSE, L"bmp", CA2W(DirectoryName), OFN_PATHMUSTEXIST, CA2W(Filter), NULL);	if (dlg.DoModal() == IDOK) {		char	FileName[512];		strcpy_s(FileName, CT2A(dlg.GetPathName()));		imwrite(FileName, DispBuf);	}}
开发者ID:tsimons89,项目名称:foosballW16,代码行数:14,


示例8: EncConverterInitializeConverterA

ECDRIVER_API HRESULT EncConverterInitializeConverterA(LPCSTR lpszConverterName, BOOL bDirectionForward, int eNormOutputForm){    CStringW strConverterName = CA2W(lpszConverterName, 65001);    CSilEncConverter* pEC = GetEncConverter(strConverterName);    ATLASSERT(pEC != 0);	return pEC->Initialize(strConverterName, bDirectionForward, eNormOutputForm);}
开发者ID:bobeaton,项目名称:ec-main,代码行数:7,


示例9: LOAD_CONFIG

bool ImgConfig::parse(){    Json::Value value;    LOAD_CONFIG(ConfigFile::ImgConfigPath, value);    Json::Value jsonRoot = value["resimg"];    if (jsonRoot == Json::nullValue)    {        return false;    }    csResPath = CA2W(jsonRoot["res_path"].asCString(), CP_UTF8).m_psz;//     CStringA strPath;//     int nImgId = 0;//     int nSize = jsonRoot.size();// //     for (int nIndex = 0; nIndex < nSize; ++nIndex)//     {//         Json::Value jsonIndexValue = jsonRoot[nIndex];// //         if (jsonIndexValue == Json::nullValue)//         {//             continue;//         }// //         nImgId = jsonIndexValue["img_id"].asInt();//         strPath = jsonIndexValue["img_path"].asCString();//         mapResImg[nImgId] = CA2W(strPath, CP_UTF8).m_psz;//         nImgId = 0;//     }    return true;}
开发者ID:GongT,项目名称:zpublic,代码行数:35,


示例10: FetchData

万事OK自学网:51自学网_软件自学网_CAD自学网自学excel、自学PS、自学CAD、自学C语言、自学css3实例,是一个通过网络自主学习工作技能的自学平台,网友喜欢的软件自学网站。