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


C++ UnicodeString::w_str方法代码示例

本文整理汇总了C++中UnicodeString::w_str方法的典型用法代码示例。如果您正苦于以下问题:C++ UnicodeString::w_str方法的具体用法?C++ UnicodeString::w_str怎么用?C++ UnicodeString::w_str使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在UnicodeString的用法示例。


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

示例1: GetObjectAttribute

dcmapWCSTR THTMLFrame::GetObjectAttribute(dcmapWCSTR szObjID,dcmapWCSTR szAttribute)
{
	 static UnicodeString buf;

	 if(WideSameText(szAttribute,L"visible"))
	 {
		return GetObjectVisible(szObjID)?L"1":L"0";
	 }

	 if(WideSameText(szObjID,L"width")) buf = IntToStr(Width);
	 else if(WideSameText(szObjID,L"height")) buf = IntToStr(Height);
	 else
	 {
		 TObject* pCntr = Html->IDControl[szObjID];
		 if(!pCntr)return 0;

		 TsEdit* pEdit =  dynamic_cast<TsEdit*>(pCntr);
		 if(pEdit)
		 {
			 if(WideSameText(szAttribute,L"value"))
			 {
				 buf = pEdit->Text;
				 return buf.w_str();
			 }
		 }
		 return 0;
	 }
	 return buf.w_str();
}
开发者ID:JlblC,项目名称:dcmap,代码行数:29,代码来源:UIHTMLFrame.cpp

示例2: EncryptButtonClick

//---------------------------------------------------------------------------
void __fastcall TTestForm::EncryptButtonClick(TObject *Sender)
{
	if(!m_bInitialized)
	{
		MessageBoxA(this->Handle,
			"Криптографічну бібліотеку не ініціалізовано",
			"Повідомлення оператору",
			MB_ICONERROR);

		return;
	}

	if(!m_pInterface->IsPrivateKeyReaded())
	{
		MessageBoxA(this->Handle,
			"Ключ не зчитано",
			"Повідомлення оператору",
			MB_ICONERROR);

		return;
	}

	PWCHAR pszSex[] = {L"Male", L"Female"};
	UnicodeString Data;
	DWORD dwError;
	PEU_CERTIFICATES pReceiversCerts = NULL;
	PAnsiChar pEncryptedData;

	Data = String(pszSex[SexComboBoxEx->ItemIndex]) +
		FirstNameEdit->Text + LastNameEdit->Text +
		MiddleNameEdit->Text + PassSeriesEdit->Text +
		PassNumberEdit->Text + DRFOEdit->Text +
		RoleEdit->Text;

	dwError = m_pInterface->GetReceiversCertificates(&pReceiversCerts);

	if(dwError != EU_ERROR_NONE)
		return;

	dwError = m_pInterface->EnvelopData(
		pReceiversCerts->ppCertificates[0]->pszIssuer,
		pReceiversCerts->ppCertificates[0]->pszSerial,
		AddSignCheckBox->Checked,
		(PBYTE) Data.w_str(), Data.Length() * 2,
		&pEncryptedData, NULL, 0);

	m_pInterface->FreeReceiversCertificates(pReceiversCerts);

	if(dwError != EU_ERROR_NONE)
		  return;

	SignRichEdit->Lines->Clear();
	SignRichEdit->Lines->Add(pEncryptedData);

	m_pInterface->FreeMemory(pEncryptedData);
}
开发者ID:Arkad202,项目名称:DSD,代码行数:57,代码来源:Main.cpp

示例3: UnicodeString

UnicodeString __fastcall md5(UnicodeString Pass)
{
  wchar_t *ww;
  MD5 *md;
  ww = Pass.w_str();
  std::wstring wstr = ww;
  std::string str = std::string(wstr.begin(), wstr.end());
  md = new MD5();
  md->add(str.c_str(), str.length());
  str = md->getHash();
  return UnicodeString(str.c_str());
}
开发者ID:JoleX-OpenStart,项目名称:DNZHelper,代码行数:12,代码来源:uReg.cpp

示例4: VerifyButtonClick

//---------------------------------------------------------------------------
void __fastcall TTestForm::VerifyButtonClick(TObject *Sender)
{
	if(!m_bInitialized)
	{
		MessageBoxA(this->Handle,
			"Криптографічну бібліотеку не ініціалізовано",
			"Повідомлення оператору",
			MB_ICONERROR);

		return;
	}

	PWCHAR pszSex[] = {L"Male", L"Female"};
	UnicodeString S = "";
	UnicodeString Data;
	DWORD dwError;
	EU_SIGN_INFO SignInfo;
	PBYTE pbData;
	DWORD dwDataLength;
	PAnsiChar pHash;

	for(INT i = 0; i < SignRichEdit->Lines->Count; i ++)
		S += SignRichEdit->Lines->Strings[i];

	if(UseRawSignCheckBox->Checked)
	{
		Data = String(pszSex[SexComboBoxEx->ItemIndex]) +
			FirstNameEdit->Text + LastNameEdit->Text +
			MiddleNameEdit->Text + PassSeriesEdit->Text +
			PassNumberEdit->Text + DRFOEdit->Text +
			RoleEdit->Text;

		dwError = m_pInterface->RawVerifyData(
			(PBYTE) Data.w_str(), Data.Length() * 2,
			AnsiString(S).c_str(), NULL, 0, &SignInfo);
		if(dwError != EU_ERROR_NONE)
			return;
	}
	else if(UseInternalSignCheckBox->Checked)
	{
		dwError = m_pInterface->VerifyDataInternal(
			AnsiString(S).c_str(), NULL, 0,
			&pbData, &dwDataLength,
			&SignInfo);
		if(dwError != EU_ERROR_NONE)
			return;

		m_pInterface->FreeMemory(pbData);
	}
	else if(SignHashCheckBox->Enabled && SignHashCheckBox->Checked)
	{
		if(((dwError = m_pInterface->HashDataContinue(
				(PBYTE) pszSex[SexComboBoxEx->ItemIndex],
				wcslen(pszSex[SexComboBoxEx->ItemIndex]) * 2))
			!= EU_ERROR_NONE) ||
			((dwError = m_pInterface->HashDataContinue(
				(PBYTE) FirstNameEdit->Text.w_str(),
				FirstNameEdit->Text.Length() * 2))
			!= EU_ERROR_NONE) ||
			((dwError = m_pInterface->HashDataContinue(
				(PBYTE) LastNameEdit->Text.w_str(),
				LastNameEdit->Text.Length() * 2))
			!= EU_ERROR_NONE) ||
			((dwError = m_pInterface->HashDataContinue(
				(PBYTE) MiddleNameEdit->Text.w_str(),
				MiddleNameEdit->Text.Length() * 2))
			!= EU_ERROR_NONE) ||
			((dwError = m_pInterface->HashDataContinue(
				(PBYTE) PassSeriesEdit->Text.w_str(),
				PassSeriesEdit->Text.Length() * 2))
			!= EU_ERROR_NONE) ||
			((dwError = m_pInterface->HashDataContinue(
				(PBYTE) PassNumberEdit->Text.w_str(),
				PassNumberEdit->Text.Length() * 2))
			!= EU_ERROR_NONE) ||
			((dwError = m_pInterface->HashDataContinue(
				(PBYTE) DRFOEdit->Text.w_str(),
				DRFOEdit->Text.Length() * 2))
			!= EU_ERROR_NONE) ||
			((dwError = m_pInterface->HashDataContinue(
				(PBYTE) RoleEdit->Text.w_str(),
				RoleEdit->Text.Length() * 2))
			!= EU_ERROR_NONE) ||
			((dwError = m_pInterface->HashDataEnd(
				&pHash, NULL, NULL)
			!= EU_ERROR_NONE)))
		{
			m_pInterface->ResetOperation();

			return;
		}

		dwError = m_pInterface->VerifyHash(pHash, NULL, 0,
			AnsiString(S).c_str(), NULL, 0, &SignInfo);
		if(dwError != EU_ERROR_NONE)
		{
			m_pInterface->FreeMemory(pHash);

			return;
//.........这里部分代码省略.........
开发者ID:Arkad202,项目名称:DSD,代码行数:101,代码来源:Main.cpp

示例5: SignButtonClick

//---------------------------------------------------------------------------
void __fastcall TTestForm::SignButtonClick(TObject *Sender)
{
	if(!m_bInitialized)
	{
		MessageBoxA(this->Handle,
			"Криптографічну бібліотеку не ініціалізовано",
			"Повідомлення оператору",
			MB_ICONERROR);

		return;
	}

	if(!m_pInterface->IsPrivateKeyReaded())
	{
		MessageBoxA(this->Handle,
			"Ключ не зчитано",
			"Повідомлення оператору",
			MB_ICONERROR);

		return;
	}

	PWCHAR pszSex[] = {L"Male", L"Female"};
	UnicodeString Data;
	DWORD dwError;
	PAnsiChar pSign;
	PAnsiChar pHash;

	if(UseRawSignCheckBox->Checked)
	{
		Data = String(pszSex[SexComboBoxEx->ItemIndex]) +
			FirstNameEdit->Text + LastNameEdit->Text +
			MiddleNameEdit->Text + PassSeriesEdit->Text +
			PassNumberEdit->Text + DRFOEdit->Text +
			RoleEdit->Text;

		dwError = m_pInterface->RawSignData(
			(PBYTE) Data.w_str(), Data.Length() * 2,
			&pSign, NULL, NULL);
		if(dwError != EU_ERROR_NONE)
			return;
	}
	else if(UseInternalSignCheckBox->Checked)
	{
		Data = String(pszSex[SexComboBoxEx->ItemIndex]) +
			FirstNameEdit->Text + LastNameEdit->Text +
			MiddleNameEdit->Text + PassSeriesEdit->Text +
			PassNumberEdit->Text + DRFOEdit->Text +
			RoleEdit->Text;

		dwError = m_pInterface->SignDataInternal(FALSE,
			(PBYTE) Data.w_str(), Data.Length() * 2,
			&pSign, NULL, NULL);
		if(dwError != EU_ERROR_NONE)
			return;
	}
	else if(SignHashCheckBox->Enabled && SignHashCheckBox->Checked)
	{
		if(((dwError = m_pInterface->HashDataContinue(
				(PBYTE) pszSex[SexComboBoxEx->ItemIndex],
				wcslen(pszSex[SexComboBoxEx->ItemIndex]) * 2))
			!= EU_ERROR_NONE) ||
			((dwError = m_pInterface->HashDataContinue(
				(PBYTE) FirstNameEdit->Text.w_str(),
				FirstNameEdit->Text.Length() * 2))
			!= EU_ERROR_NONE) ||
			((dwError = m_pInterface->HashDataContinue(
				(PBYTE) LastNameEdit->Text.w_str(),
				LastNameEdit->Text.Length() * 2))
			!= EU_ERROR_NONE) ||
			((dwError = m_pInterface->HashDataContinue(
				(PBYTE) MiddleNameEdit->Text.w_str(),
				MiddleNameEdit->Text.Length() * 2))
			!= EU_ERROR_NONE) ||
			((dwError = m_pInterface->HashDataContinue(
				(PBYTE) PassSeriesEdit->Text.w_str(),
				PassSeriesEdit->Text.Length() * 2))
			!= EU_ERROR_NONE) ||
			((dwError = m_pInterface->HashDataContinue(
				(PBYTE) PassNumberEdit->Text.w_str(),
				PassNumberEdit->Text.Length() * 2))
			!= EU_ERROR_NONE) ||
			((dwError = m_pInterface->HashDataContinue(
				(PBYTE) DRFOEdit->Text.w_str(),
				DRFOEdit->Text.Length() * 2))
			!= EU_ERROR_NONE) ||
			((dwError = m_pInterface->HashDataContinue(
				(PBYTE) RoleEdit->Text.w_str(),
				RoleEdit->Text.Length() * 2))
			!= EU_ERROR_NONE) ||
			((dwError = m_pInterface->HashDataEnd(
				&pHash, NULL, NULL)
			!= EU_ERROR_NONE)))
		{
			m_pInterface->ResetOperation();

			return;
		}

//.........这里部分代码省略.........
开发者ID:Arkad202,项目名称:DSD,代码行数:101,代码来源:Main.cpp

示例6:

//---------------------------------------------------------------------------
void WorkKompas5::ShowError(UnicodeString S)
{
		MessageBox(NULL, S.w_str(), L"Error", MB_ICONERROR);
}
开发者ID:VLunev,项目名称:ZKOKompas,代码行数:5,代码来源:WorkKompas7.cpp


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