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

C++ LPCSTR函数代码示例

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

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



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

示例1: InitWindow

//--------------------------------------------------------------------------------------
// Регистрация класса и создание окна
//--------------------------------------------------------------------------------------
HRESULT InitWindow(HINSTANCE hInstance, int nCmdShow)
{
  // Регистрация класса
  WNDCLASSEX wcex;
  wcex.cbSize = sizeof(WNDCLASSEX);
  wcex.style = CS_HREDRAW | CS_VREDRAW;
  wcex.lpfnWndProc = WndProc;
  wcex.cbClsExtra = 0;
  wcex.cbWndExtra = 0;
  wcex.hInstance = hInstance;
  wcex.hIcon = LoadIcon(hInstance, (LPCTSTR)IDI_ICON1);
  wcex.hCursor = LoadCursor(NULL, IDC_ARROW);
  wcex.hbrBackground = (HBRUSH)(COLOR_WINDOW + 1);
  wcex.lpszMenuName = NULL;
  wcex.lpszClassName = LPCSTR("TorusWindowClass");
  wcex.hIconSm = LoadIcon(wcex.hInstance, (LPCTSTR)IDI_ICON1);

  if(!RegisterClassEx(&wcex))
    return E_FAIL;

  // Создание окна
  g_hInst = hInstance;
  RECT rc = { 0, 0, WINDOW_SIZE_WIDTH, WINDOW_SIZE_HEIGHT };
  AdjustWindowRect(&rc, WS_OVERLAPPEDWINDOW, FALSE);

  g_hWnd = CreateWindow(LPCSTR("TorusWindowClass"), LPCSTR(WINDOW_TITLE), WS_OVERLAPPEDWINDOW,
                        CW_USEDEFAULT, CW_USEDEFAULT, rc.right - rc.left, rc.bottom - rc.top, NULL, NULL, hInstance,
                        NULL);
  if(!g_hWnd)
    return E_FAIL;

  ShowWindow(g_hWnd, nCmdShow);
  return S_OK;
}
开发者ID:fhdns,项目名称:ConwayGameOfLife,代码行数:37,代码来源:main.cpp


示例2: SetSelectTarget

/*
// Seleciona um target
static int SetSelectTarget(lua_State *L) // SetSelectTarget(id_target)
{
	int id_target = (int)luaL_checknumber(L, 1);

	__try
	{
		__asm
		{
		   // Select Target (GetTarget)
		   mov eax, TargetHandlerLoL
		   add eax, offset_targetselect;
		   mov ebx, id_target
		   mov dword ptr ds:[eax], ebx
		}
	}
	__except(EXCEPTION_EXECUTE_HANDLER)
	{
		MessageBox(0, LPCSTR("SetSelectTarget() failed - exception"), LPCSTR("Exception Error"), 0);
	}
}

// Captura o ID do Target Selecionado
static int GetSelectIDTarget(lua_State *L)
{
	int tmp;
	__try
	{
		__asm
		{
		   // Select Target (GetTarget)
		   mov eax, TargetHandlerLoL
		   add eax, offset_targetselect;
		   mov ebx, dword ptr ds:[eax]
		   mov tmp, ebx
		}

		if(tmp != 0x00)
		{
			ObjectTarget.SelectTargetID = tmp;
		}
	}
	__except(EXCEPTION_EXECUTE_HANDLER)
	{
	 MessageBox(0, LPCSTR("GetSelectTarget() failed - exception"), LPCSTR("Exception Error"), 0);
	}

	lua_pushnumber(L, tmp);
	return 1;// Returno TMP for LUA ...
}
*/
void AutoCursorTarget()
{
	if(TargetHandlerLoL == 0x00)
	 TargetHandlerLoL = GetModuleLoL();

	int tmp;
	if(StatAutoCursorTarget)
	{
		__try
		{
		 __asm
		 {
			// Mouse Target
			mov eax, TargetHandlerLoL
			add eax, 0x29828A4			// 27/02/2014	**********************************
			mov ebx, dword ptr ds:[eax]
			mov tmp, ebx
		 }
		 if(tmp != 0x00)
		 {
		  __asm
		  {
		    // Select Target
			mov eax, TargetHandlerLoL
		    add eax, offset_targetselect;
			mov dword ptr ds:[eax], ebx
		  }
	     }
		}
		__except(EXCEPTION_EXECUTE_HANDLER)
		{
			MessageBox(0, LPCSTR("SetAutoCursorTarget(true) failed - exception"), LPCSTR("Exception Error"), 0);
		}
	}
开发者ID:Areidz,项目名称:BotScript,代码行数:86,代码来源:target.cpp


示例3: SetMaxZoom

int SetMaxZoom(lua_State *L) // SetMaxZoom(ValueZoom)
{
    if(OtherHandlerLoL == 0x00)
        OtherHandlerLoL = GetModuleLoL();

    float zoom = (float)luaL_checknumber(L, 1);
    __try
    {
        pVirtualProtect = (unsigned char*)OtherHandlerLoL+0x0CD11FC;
        VirtualProtect(pVirtualProtect, 4, PAGE_EXECUTE_READWRITE, &lpflOldProtect);
        __asm
        {
            mov eax, OtherHandlerLoL
            add eax, 0x0CD11FC 			// 28/02/2014	**********************************
            mov ebx, zoom
            mov dword ptr ds:[eax], ebx
        }
    }
    __except(EXCEPTION_EXECUTE_HANDLER)
    {
        MessageBox(0, LPCSTR("SetMaxZoom(ValueZoom) failed - exception"), LPCSTR("Exception Error"), 0);
    }

    return 0;
}
开发者ID:Lucas-Firefox,项目名称:BotScriptLOL,代码行数:25,代码来源:other.cpp


示例4: memset

void CStartTargetDB::OnSuOk() 
{
	// TODO: Add your control notification handler code here
	int i, maxcount = m_ListDB.GetCount();
	CString	tmpString;
	bool bResult;
	char sSucDB[1024];
	memset( sSucDB, 0x00, sizeof( sSucDB ) );
	CString msg;

	for (i = 0; i < maxcount; i++) {
		if (m_ListDB.GetSel(i) > 0) {
			m_ListDB.GetText(i, tmpString);
			bResult = cCUBRID->bStartCUBRID((char *)LPCSTR( tmpString ) );
TRACE2( "Start DB( %s ) : %s\n", (char *)LPCSTR( tmpString ), bResult?"TRUE":"FALSE" );

			if( bResult )
			{
				if( strlen( sSucDB ) <= 0 ) sprintf( sSucDB, "%s", (char *)LPCSTR( tmpString ) );
				else                        sprintf( sSucDB, "%s, %s", sSucDB, (char *)LPCSTR( tmpString ) );
			}
		}
	}

//	msg.Empty();
//	msg.Format(theLang.GetMessage(MSG_START), sSucDB);
//	AfxMessageBox(msg, MB_OK | MB_ICONINFORMATION);

	CDialog::OnOK();
	
}
开发者ID:CUBRID,项目名称:cubrid,代码行数:31,代码来源:STARTTARGETDB.CPP


示例5: Section

BOOL CHandoutDoc::ParseHandoutSection(CString &strSection)
{
    CParseBuffer Section(strSection);
    Section.IgnoreLineFeeds();
    while( Section.IsEmpty() == FALSE )
    {
        CString strKey = Section.ExtractQuotedString();
        CString strValue = Section.ExtractQuotedString();
        if( Section.IsUnderflow() == FALSE && Section.IsParseError() == FALSE )
        {
            if( strKey.CompareNoCase( "Template" ) == 0 ) m_strSheet = strValue; else
            if( strnicmp( strKey, "TEXT", 4 ) == 0 )
            {
                int i = atoi( LPCSTR(strKey)+4 );
                if( i >= 0 && i < MAX_HANDOUT_TEXT_FIELDS ) m_strStrings[i] = strValue;
            }
            else
            if( strnicmp( strKey, "PICTURE", 7 ) == 0 )
            {
                int i = atoi( LPCSTR(strKey)+7 );
                if( i >= 0 && i < MAX_HANDOUT_PICTURE_FIELDS ) m_strPictures[i] = strValue;
            }
        }
        else
            return FALSE;
    }

    return TRUE;

}
开发者ID:DrDub,项目名称:Byakhee,代码行数:30,代码来源:HandoutDoc.cpp


示例6: MessageBeep

void CRootDlg::OnOK() 
{
	CString result;

	if(m_BtnPrev.GetCheck()){
		m_PrevList.GetText(m_PrevList.GetCurSel(), result);
	}
	else{
		m_CustomName.GetWindowText(result);
		if(result==""){
			MessageBeep(MB_ICONERROR);
			return;
		}

		char full[MAX_PATH];
		_fullpath(full, LPCSTR(result), MAX_PATH);
		result = CString(full);

		result.Replace('/', '\\');
		if(result[result.GetLength()-1]!='\\') result += '\\';
		m_CustomName.SetWindowText(result);
	}

	// check whether the filename lies within this folder
	if(m_Filename!=""){
		CString filename = m_Filename;
		filename.Replace('/', '\\');
		if(result!=filename.Left(result.GetLength())){
			MessageBox("Folder '" + result + "' is not a parent folder of file '" + m_Filename + "'.", "Error", MB_ICONERROR);
			return;
		}
	}


	DWORD attr = GetFileAttributes(LPCSTR(result));
	if(attr == 0xFFFFFFFF || (attr & FILE_ATTRIBUTE_DIRECTORY) == 0){
		if(MessageBox("Folder '" + result + "' doesn't exist.\nDo you want to create it?", NULL, MB_ICONQUESTION|MB_OKCANCEL)!=IDOK) return;

		result = MakePath(result);
		if(result==""){
			MessageBox("The specified folder cannot be created.", "Error", MB_ICONERROR);
			return;
		}
	}
/*
	CFileFind finder;
	if(!finder.FindFile(result + "startup.settings")){
		if(MessageBox("This doesn't appear to be a valid root folder (the 'startup.settings' file was not found).\n\nDo you want to continue anyway?", "Warning", MB_ICONWARNING|MB_YESNO)!=IDYES) return;
	}
*/
	CFileFind finder;
	if(!finder.FindFile(result + "*.wpr")){
		if(MessageBox("This doesn't appear to be a valid root folder (no project file was found).\n\nDo you want to continue anyway?", "Warning", MB_ICONWARNING|MB_YESNO)!=IDYES) return;
	}
	
	m_SelectedFolder = result;

	
	CDialog::OnOK();
}
开发者ID:segafan,项目名称:wme1_jankavan_tlc_edition-repo,代码行数:60,代码来源:RootDlg.cpp


示例7: _T

/**
	@brief	Assigned Load의 RouteGroup을 원상복귀

	@author KHS	

	@date 2009-05-26 오전 10:25:21	

	@param	

	@return		
**/
int CCableRouteAssignTOLoadDlg::MoveToOriginalRouteGroup(void)
{
	for(map<CELoadItem*,string>::iterator itr = m_LoadRouteGroupMap.begin();itr != m_LoadRouteGroupMap.end();++itr)
	{
		itr->first->prop()->SetValue(_T("Cable Route") , _T("Route Group") , itr->second);
	}

	DisplayRouteGroupData();
	
	CString rLoadArea, rBusId;
	int nSelItem = m_wndLoadAreaCombo.GetCurSel();
	if( -1 != nSelItem) m_wndLoadAreaCombo.GetLBText(nSelItem , rLoadArea);

	nSelItem = m_wndSortByBusCombo.GetCurSel();
	if(-1 != nSelItem) m_wndSortByBusCombo.GetLBText(nSelItem, rBusId);

	if(m_wndRouteGrListCtrl.GetItemCount() > 0)
	{
		const string rRouteGroup = m_wndRouteGrListCtrl.GetItemText(0 , 0);
		m_wndRouteGrListCtrl.SetFocus();
		// Turn off hilight for previous drop target
		m_wndRouteGrListCtrl.SetItemState(0, LVIS_FOCUSED | LVIS_SELECTED, LVIS_FOCUSED | LVIS_SELECTED);
		// Redraw previous item
		m_wndRouteGrListCtrl.RedrawItems (0, 0);
		
		DisplayLoadHasRouteGroup(m_wndAssignLoadListCtrl , rRouteGroup, rLoadArea.operator LPCSTR(), rBusId.operator LPCSTR());
	}
	DisplayLoadHasRouteGroup(m_wndNotAssignLoadListCtrl , _T(""), rLoadArea.operator LPCSTR(), rBusId.operator LPCSTR());

	return ERROR_SUCCESS;
}
开发者ID:radtek,项目名称:e-load,代码行数:42,代码来源:CableRouteAssignTOLoadDlg.cpp


示例8: _splitpath

CString CUtils::MakePath(CString Path)
{
	char drive[_MAX_DRIVE+1];
	char path[_MAX_PATH+1];
	int i;
	CString result;

	if(Path[Path.GetLength()-1] != '\\')
	{
		_splitpath(LPCSTR(Path), drive, path, NULL, NULL);
		Path = CString(drive) + CString(path);
	}
	if(Path[Path.GetLength()-1] != '\\') Path += '\\';


	for(i = 0; i<Path.GetLength(); i++)
		if(Path[i] == '/') Path.SetAt(i, '\\');

	for(i = 0; i<Path.GetLength(); i++)
		if(i == 0 || Path[i] != '\\' || (Path[i] == '\\' && Path[i-1] != '\\')){
			result += Path[i];
			if(Path[i] == '\\'){
				CreateDirectory(LPCSTR(result), NULL);
				DWORD attr = GetFileAttributes(LPCSTR(result));
				if(attr == 0xFFFFFFFF || (attr & FILE_ATTRIBUTE_DIRECTORY) == 0) return "";
			}

		}

		return result;
}
开发者ID:segafan,项目名称:wme1_jankavan_tlc_edition-repo,代码行数:31,代码来源:Utils.cpp


示例9: atoi

void CUCPDetail::OnUcpdApply()
{
CString	tempstr;

	m_ucpd_broker.GetWindowText(m_ucinfo->m_broker);
	if (m_ucpd_service.GetCheck() == 0) {
		m_ucinfo->m_service = false;
	} else {
		m_ucinfo->m_service = true;
	}
	m_ucinfo->m_appl_server = m_ucpd_appl_server.GetCurSel();
	m_ucpd_broker_port.GetWindowText(m_ucinfo->m_broker_port);
	m_ucpd_appl_server_shm_id.GetWindowText(m_ucinfo->m_appl_server_shm_id);
	if (m_ucpd_auto_add_appl_server.GetCheck() == 0) {
		m_ucinfo->m_auto_add_appl_server = false;
	} else {
		m_ucinfo->m_auto_add_appl_server = true;
	}
	m_ucpd_min_num_appl_server.GetWindowText(tempstr);
	m_ucinfo->m_min_num_appl_server = atoi(LPCSTR(tempstr));
	m_ucpd_max_num_appl_server.GetWindowText(tempstr);
	m_ucinfo->m_max_num_appl_server = atoi(LPCSTR(tempstr));
	m_ucpd_appl_server_max_size.GetWindowText(tempstr);
	m_ucinfo->m_appl_server_max_size = atoi(LPCSTR(tempstr));

	CheckFile(m_ucpd_log_dir, false);
	m_ucpd_log_dir.GetWindowText(m_ucinfo->m_log_dir);
	if (m_ucpd_log_backup.GetCheck() == 0) {
		m_ucinfo->m_log_backup = false;
	} else {
		m_ucinfo->m_log_backup = true;
	}
	if (m_ucpd_sql_log.GetCheck() == 0) {
		m_ucinfo->m_sql_log = false;
	} else {
		m_ucinfo->m_sql_log = true;
	}
	if (m_ucpd_access_log.GetCheck() == 0) {
		m_ucinfo->m_access_log = false;
	} else {
		m_ucinfo->m_access_log = true;
	}

	if (m_ucpd_security.GetCheck() == 0) {
		m_ucinfo->m_security = false;
	} else {
		m_ucinfo->m_security = true;
	}
	CheckFile(m_ucpd_access_list);
	m_ucpd_access_list.GetWindowText(m_ucinfo->m_access_list);

	CheckFile(m_ucpd_source_env);
	m_ucpd_source_env.GetWindowText(m_ucinfo->m_source_env);
	m_ucpd_time_to_kill.GetWindowText(m_ucinfo->m_time_to_kill);
	m_ucpd_session_timeout.GetWindowText(m_ucinfo->m_session_timeout);
	m_ucpd_job_queue_size.GetWindowText(m_ucinfo->m_job_queue_size);

	CDialog::OnOK();
}
开发者ID:CUBRID,项目名称:cubrid,代码行数:59,代码来源:UCPDETAIL.CPP


示例10: strcpy

////////////////////////////////////////////////////////////////////////////////
// Saves the file strFilePath after getting it from the ars server
CFieldValuePair::DumpAttachment(CARSConnection &arsConnect, CString Form, 
								CEntryId EntryId, ARInternalId arsFieldId,
								CString strFilePath)
{
	ARNameType arsFormName; // working variable
	AREntryIdList arsEntryId; // working variable
	ARLocStruct arsLocStruct; // working variable
	ARStatusList arsStatusList; // working variable

	// Build ARNameType formName
	strcpy( (char*)arsFormName, LPCSTR(Form.Left(sizeof(ARNameType))) ); // copy form name, truncating if necessary
	if(Form.GetLength() > sizeof(ARNameType))
	{
		// Output truncation to log file
		CString strLog("CFieldValuePair::DumpAttachment()");
		strLog += "\tForm name truncated due because size exceeded limits.  Original name: ";
		strLog += Form;
		strLog += INDENT;
		strLog += "Truncated name: ";
		strLog += (char*)arsFormName;
//		Log(strLog);
	}
	// Build AREntryIdList entryId. Will be entry id to get blob for
	if(!FillEntryId(EntryId, &arsEntryId))
	{
		// output to error log here
		CString strLog;
		strLog = "\tAttachment \"";
		strLog += strFilePath;
		strLog += "\" not saved because FillEntryId() failed.\t";
		strLog += "CFieldValuePair::DumpAttachment()";
		Log(strLog);
		ThrowARSException(LPCSTR(strLog), "CFieldValuePair::DumpAttachment()");
	}

	// Build ARLocStruct. Will hold the filename to save the attachment to.
	if(!FillARLocStruct(strFilePath, arsLocStruct))
	{
		// output to error log here
		CString strLog;
		strLog = "\tAttachment \"";
		strLog += strFilePath;
		strLog += "\" not saved because FillARLocStruct() failed.\t";
		strLog += "CFieldValuePair::DumpAttachment()";
		Log(strLog);
		ThrowARSException(LPCSTR(strLog), "CFieldValuePair::DumpAttachment()");
	}

	// Call ARGetEntryBLOB to dump the attachment
	if(ARGetEntryBLOB(&arsConnect.LoginInfo, arsFormName, &arsEntryId,
					  arsFieldId, &arsLocStruct, &arsStatusList) > AR_RETURN_OK)
	{
		ThrowARSException(arsStatusList, "CFieldValuePair::DumpAttachment");
	}

	// Free up heap memory
	FreeAREntryIdList(&arsEntryId, FALSE);
	FreeARLocStruct(&arsLocStruct, FALSE);
}
开发者ID:mellertson,项目名称:ARExplorer,代码行数:61,代码来源:Record.cpp


示例11: CString

void CSpritePage::OnAddFrame() 
{
	CString ret = "";
	CBGame* Game = m_View->m_Sprite->Game;

	CString InitFile="";
	if(m_View->m_SelectedSubframe) InitFile = m_View->m_SelectedSubframe->m_Surface->m_Filename;

	// make absolute path
	Game->m_FileManager->RestoreCurrentDir();
	for(int i=0; i<Game->m_FileManager->m_SinglePaths.GetSize(); i++){
		CString NewPath = CString(Game->m_FileManager->m_SinglePaths[i]) + InitFile;
		CFileFind finder;
		if(finder.FindFile(NewPath)){
			InitFile = NewPath;
			break;
		}
	}

	CString Filter = "Image files (*.bmp; *.tga; *.png; *.jpg)|*.bmp;*.tga;*.png;*.jpg|All Files (*.*)|*.*||";
	CFileDialog dlg(TRUE, NULL, InitFile, OFN_ALLOWMULTISELECT|OFN_HIDEREADONLY|OFN_ENABLESIZING|OFN_FILEMUSTEXIST|OFN_PATHMUSTEXIST|OFN_NOCHANGEDIR, Filter, this);
	char NameBuffer[32768+1] = "";
	dlg.m_ofn.lpstrFile = NameBuffer;
	dlg.m_ofn.nMaxFile = 32768;
	if(InitFile=="") InitFile = CString(Game->m_FileManager->m_BasePath);
	dlg.m_ofn.lpstrInitialDir = LPCSTR(InitFile);
	
	if(dlg.DoModal()==IDOK){
		m_View->SetUndoState("Add frame(s)");
		POSITION pos = dlg.GetStartPosition();
		while(pos){
			CString filename = dlg.GetNextPathName(pos);
			char* str = new char[filename.GetLength()+1];
			strcpy(str, LPCSTR(filename));
			Game->m_FileManager->MakeRelativePath(str);

			CBSurface* surf = Game->m_SurfaceStorage->AddSurface(str);
			if(surf){
				CBFrame* frame = ::new CBFrame(Game);
				CBSubFrame* subframe = ::new CBSubFrame(Game);
				subframe->m_Surface = surf;
				subframe->SetDefaultRect();
				frame->m_Subframes.Add(subframe);

				int i = m_View->m_Sprite->m_CurrentFrame+1;
				if(i<m_View->m_Sprite->m_Frames.GetSize())
					m_View->m_Sprite->m_Frames.InsertAt(i, frame);
				else{
					m_View->m_Sprite->m_Frames.Add(frame);					
				}
				m_View->m_Sprite->m_CurrentFrame=i;
				m_View->m_SelectedSubframe = subframe;
			}
			else MessageBox("Error loading image \"" + filename + "\".", NULL, MB_OK|MB_ICONERROR);
			delete [] str;
		}
		Redraw();
	}
}
开发者ID:segafan,项目名称:wme1_jankavan_tlc_edition-repo,代码行数:59,代码来源:SpritePage.cpp


示例12: LoadShaders

//--------------------------------------------------------------------------------------
// Создание буфера вершин, шейдеров (shaders) и описания формата вершин (input layout)
//--------------------------------------------------------------------------------------
HRESULT LoadShaders()
{
  HRESULT hr = S_OK;

  // Компиляция вершинного шейдера из файла
  ID3DBlob* pVSBlob = NULL; // Вспомогательный объект
  hr = CompileShaderFromFile(LPCSTR("shaders.fx"), "VS", "vs_4_0", &pVSBlob);
  if (FAILED(hr))
  {
    MessageBox(NULL, LPCSTR("Невозможно скомпилировать файл FX. Пожалуйста, запустите данную программу из папки, содержащей файл FX."), LPCSTR("Ошибка"), MB_OK);
    return hr;
  }

  // Создание вершинного шейдера
  hr = g_pd3dDevice->CreateVertexShader(pVSBlob->GetBufferPointer(), pVSBlob->GetBufferSize(), NULL, &g_pVertexShader);
  if (FAILED(hr))
  {  
    pVSBlob->Release();
    return hr;
  }

  // Определение шаблона вершин
  D3D11_INPUT_ELEMENT_DESC layout[] =
  {
    { "POSITION", 0, DXGI_FORMAT_R32G32B32_FLOAT, 0, 0, D3D11_INPUT_PER_VERTEX_DATA, 0 },
    { "COLOR", 0, DXGI_FORMAT_R32G32B32A32_FLOAT, 0, 12, D3D11_INPUT_PER_VERTEX_DATA, 0 },
  };
  UINT numElements = ARRAYSIZE(layout);

  // Создание шаблона вершин
  hr = g_pd3dDevice->CreateInputLayout(layout, numElements, pVSBlob->GetBufferPointer(),
                                       pVSBlob->GetBufferSize(), &g_pVertexLayout);
  pVSBlob->Release();
  if (FAILED(hr))
    return hr;

  // Подключение шаблона вершин
  g_pImmediateContext->IASetInputLayout(g_pVertexLayout);

  // Компиляция пиксельного шейдера из файла
  ID3DBlob* pPSBlob = NULL;
  hr = CompileShaderFromFile(LPCSTR("shaders.fx"), "PS", "ps_4_0", &pPSBlob);

  if(FAILED(hr))
  {
    MessageBox(NULL, LPCSTR("Невозможно скомпилировать файл FX. Пожалуйста, запустите данную программу из папки, содержащей файл FX."), LPCSTR("Ошибка"), MB_OK);
    return hr;
  }

  // Создание пиксельного шейдера
  hr = g_pd3dDevice->CreatePixelShader(pPSBlob->GetBufferPointer(), pPSBlob->GetBufferSize(), NULL, &g_pPixelShader);
  pPSBlob->Release();

  if (FAILED(hr))
    return hr;

  return hr;
}
开发者ID:fhdns,项目名称:ConwayGameOfLife,代码行数:61,代码来源:main.cpp


示例13: Initialize

bool CFilterScript::Initialize(CPackageBuilder::TPackage* Package)
{
	m_Document->PrioritizePackage(Package->Name);
	m_Game->m_Registry->SetIniName((char*)LPCSTR(m_Document->GetPathName()));
	m_Game->m_FileManager->SetBasePath((char*)LPCSTR(m_Document->m_ProjectRoot));
	m_Game->m_ScEngine->EmptyScriptCache();

	return true;
}
开发者ID:segafan,项目名称:wme1_jankavan_tlc_edition-repo,代码行数:9,代码来源:FilterScript.cpp


示例14: PREF_SetBoolPref

BOOL
CPublishPrefs::ApplyChanges()
{
    PREF_SetBoolPref("editor.publish_keep_links",(XP_Bool)m_bAutoAdjustLinks);
    PREF_SetBoolPref("editor.publish_keep_images",(XP_Bool)m_bKeepImagesWithDoc);
    PREF_SetCharPref("editor.publish_location",LPCSTR(m_strPublishLocation));
	PREF_SetCharPref("editor.publish_browse_location",LPCSTR(m_strBrowseLocation));
	return TRUE;
}
开发者ID:vicamo,项目名称:b2g_mozilla-central,代码行数:9,代码来源:edpages.cpp


示例15: MultiByteToWideChar

//
// CStringA转CStringW  Unicode环境下
//
CStringW CDesktopDlg::CStrA2CStrW(const CStringA &cstrSrcA)
{
	int len = MultiByteToWideChar(CP_ACP, 0, LPCSTR(cstrSrcA), -1, NULL, 0);
	wchar_t *wstr = new wchar_t[len];
	memset(wstr, 0, len*sizeof(wchar_t));
	MultiByteToWideChar(CP_ACP, 0, LPCSTR(cstrSrcA), -1, wstr, len);
	CStringW cstrDestW = wstr;
	delete[] wstr;
	return cstrDestW;
}
开发者ID:blackye,项目名称:remote_control,代码行数:13,代码来源:DesktopDlg.cpp


示例16: UpdateData

void CSysConfig::OnBnClickedOk()
{
	// TODO: 在此添加控件通知处理程序代码
	UpdateData(TRUE);


//	FilePath=".\\config\\config.ini";

	CString strSection = _T("PathofDatabase");
	CString strSectionKey  = _T("DataFile");
	CString strValue  = _T("");
	GetDlgItemText(IDC_EDIT_FILEPATH,strValue);
    WritePrivateProfileString(LPCSTR(strSection),LPCSTR(strSectionKey),LPCSTR(strValue), FilePath);

	strSectionKey = _T("Password");
	strValue  = _T("");
	GetDlgItemText(IDC_EDIT_DATAPASSWORD, strValue);
	strValue = CCrypt::Encrypt(strValue, 2005);
	WritePrivateProfileString(LPCSTR(strSection),LPCSTR(strSectionKey),LPCSTR(strValue), FilePath);

	if(m_bTip&&!m_bTip2)
		strValue=_T("1");
	else if(!m_bTip&&m_bTip2)
        strValue=_T("2");
	else
		strValue=_T("0");


	strSectionKey = _T("Tips");
	WritePrivateProfileString(LPCSTR(strSection),LPCSTR(strSectionKey),LPCSTR(strValue), FilePath);
//	EndDialog(IDOK); // 关闭对话框
	UpdateData(FALSE);
	OnOK();

}
开发者ID:mikewolfli,项目名称:PEMSys,代码行数:35,代码来源:SysConfig.cpp


示例17: LPCSTR

LPCSTR Menu::GetNstr(int n){
	int j=0;
	int i;
	tmpstr[0]=0;
	if(!int(items))return LPCSTR(&tmpstr);
	for(i=0;j<n&&items[i]!=0;i++)
	{
		if(items[i]=='|')j++;
	};
	if(j!=n)return LPCSTR(&tmpstr);
	for(int k=0;items[i]!=0&&items[i]!='|';i++,k++)
		tmpstr[k]=items[i];
	tmpstr[k]=0;
	return LPCSTR(&tmpstr);
};
开发者ID:agend,项目名称:warcraft-2000-nuclear-epidemic,代码行数:15,代码来源:menu.cpp


示例18: ASSERT_VALID

void CWaitingUserInfo::HandleReply( CHotlineTransaction* pTrans, class CHotlineConnection* pConnection )
	{
	ASSERT_VALID( pTrans );
	ASSERT( pConnection );
	if ( pTrans->GetError( ) )
		{
		CItem* pErrorMessage = pTrans->GetItemByType( HLO_ERRORMSG );
		pConnection->UserInfoReceived( false, m_iUserSocket, NULL, ( pErrorMessage ) ? LPCSTR( pErrorMessage->AsString( ) ) : NULL );
		}
	else
		{
		CItem* pInfo = pTrans->GetItemByType( HLO_MESSAGE );
		pConnection->UserInfoReceived( true, m_iUserSocket, ( pInfo ) ? LPCSTR( pInfo->AsString( ) ) : NULL );
		}
	}
开发者ID:Schala,项目名称:AniClient,代码行数:15,代码来源:WaitingForReply.cpp


示例19: GetWindowRect

//***************************************************************
// create ListCtrl-head
int CColorListCtrl::InitCtrl(CStringArray *phead, CByteArray *pProcent)
{
    if ( (!phead)||(!pProcent)) return 1;
	LV_COLUMN lvc;
	int cx=0;
    int count = phead->GetSize(); 
    if (count!=m_columnSize) return 2;
    if (pProcent->GetSize() != count) return 3;
    for (int x=0; x<count; x++) cx+=pProcent->GetAt(x);
    if (cx!=100) return 4;

	CRect rect_listbox;

	lvc.mask = LVCF_FMT | LVCF_WIDTH | LVCF_TEXT | LVCF_SUBITEM;
	GetWindowRect( rect_listbox );
	cx=int((rect_listbox.right-rect_listbox.left)-20); //some Pixel for Scrollbar

    //set head-columns in ListBox
	lvc.iSubItem = 0;
	lvc.fmt = LVCFMT_LEFT ;		
	
    for (x=0; x<count; x++)
    {
        lvc.cx = int(cx*pProcent->GetAt(x)/100);
	    lvc.pszText = (char*)LPCSTR(phead->GetAt(x));
	    CListCtrl::InsertColumn(x,&lvc);
    }
    return 0;
}
开发者ID:techpub,项目名称:archive-code,代码行数:31,代码来源:ColorListCtrl.cpp


示例20: filename

bool PluginInfo::loadLibrary(PluginRegistry* p)
{
	if(!loaded)
	{
		QString filename(dll_filename.c_str());
		hinst=LoadLibrary(filename.toStdWString().c_str());
		if(!hinst)
		{
			wprintf(TEXT("Failure in LoadLibrary(%s: error code %i): check for missing dependencies\n"),filename.toStdWString().c_str(),GetLastError()); 
		}
		else
		{
			PLUGIN_DLL_FUNC registerPlugin = (PLUGIN_DLL_FUNC)GetProcAddress(hinst, LPCSTR("RegisterNervePlugin"));
			if(registerPlugin)
			{
				factoryMap.clear();
			    registerPlugin(p);
				loaded=true;
			}
			else
			{
				loaded=false;
				FreeLibrary(hinst);
			}			
		}
	}
	return hinst!=0;
}
开发者ID:dmoran,项目名称:NERVE,代码行数:28,代码来源:PluginRegistry.cpp



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C++ LPCTSTR函数代码示例发布时间:2022-05-30
下一篇:
C++ LPBYTE函数代码示例发布时间: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