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


C++ ExecuteCmd函数代码示例

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


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

示例1: sdfuse_uboot

/***********************************************************************
*@函数名称: sdfuse_uboot
*@功能描述: sdfuse烧写u-boot映像文件
*@参数: 	无
*@返回:		无
*@备注:	   本u-boot未使用,real210.h中有CONFIG_FASTBOOT_SDFUSE这个定义
 **********************************************************************/
void sdfuse_uboot()
{
    char *buf;
    ulong checksum = 0;
    int i = 0;
    if(!ExecuteCmd("fatload mmc 1:1 30f00000 /sdfuse/u-boot.bin"))
    {
        buf = 0x30f00000 + 16;/*把u-boot首地址偏移16字节的内存地址赋值给buf,此时u-boot的首地址是30f00000*/
        for(i = 16; i < 8192; i++) /*循环进行u-boot的前8K代码校验和计算,i赋值为16是因为u-boot的前16字节可不必要校验和校验*/
        {
            checksum += *buf;
            buf++;
        }
        *((volatile u32 *)(0x30f00000 + 0x8)) = checksum;/*把计算出的校验和写入3ff00008地址处等待写入EMMC*/
        printf("\nBL1 checksum is:%08x\n\n", checksum);

        /*printf("erase start block 1 (count 1073 blocks)...");
        ExecuteCmd("mmc erase 1 431");*/

        printf("writing BL1 start block 1 (count 16 blocks)...");
        ExecuteCmd("mmc write 30f00000 1 10");/*烧写BL1到eMMC的第一个block,长度为16 block(注意此时是10,但是为16进制)*/

        printf("\n");
        printf("writing u-boot.bin start block 49 (count 1024 blocks)...");
        ExecuteCmd("mmc write 30f00000 31 400");/*烧写u-boot到eMMC的第49个block,长度为1024 block(注意此时是400,但是为16进制)*/
    }
}
开发者ID:advx9600,项目名称:uboot-4.4-RuiEr,代码行数:34,代码来源:real_menu.c

示例2: CMD_Keypress

//EQLIB_API VOID DoMappable(PSPAWNINFO pChar, PCHAR szLine)
int CMD_Keypress(int argc, char *argv[])
{
	if (argc<2)
	{
		WriteChatf("Syntax: %s <eqcommand|keycombo> [hold|chat]",argv[0]);
		return 0;
	}
	bool bHold=false;
	bool bChat=false;
	if (argc==3)
	{
		if (!stricmp(argv[2],"hold"))
		{
			bHold=true;
		}
		else if (!stricmp(argv[2],"chat"))
		{
			bChat=true;
		}
	}
	if (!PressMQ2KeyBind(argv[1],bHold))
	{
		int N=FindMappableCommand(argv[1]);
		if (N>=0)
		{
			ExecuteCmd(N,1,0);
			if (!bHold)
				ExecuteCmd(N,0,0);
			return 0;
		}
		KeyCombo Temp;
		if (ParseKeyCombo(argv[1],Temp))
		{
			if (bChat)
			{
				pWndMgr->HandleKeyboardMsg(Temp.Data[3],1);
				pWndMgr->HandleKeyboardMsg(Temp.Data[3],0);
			}
			else
			{
				MQ2HandleKeyDown(Temp);
				if (!bHold)
					MQ2HandleKeyUp(Temp);
			}
			return 0;
		}

		WriteChatf("Invalid mappable command or key combo '%s'",argv[1]);
		return -1;
	}
	return 0;
}
开发者ID:clausjensen,项目名称:mq,代码行数:53,代码来源:ISXEQCommands.cpp

示例3: ExecuteCmd

bool DbgGdb::DoInitializeGdb(const std::vector<BreakpointInfo> &bpList, const wxArrayString &cmds)
{
	//place breakpoint at first line
#ifdef __WXMSW__
	ExecuteCmd(wxT("set  new-console on"));
#endif
	ExecuteCmd(wxT("set unwindonsignal on"));

	if (m_info.enablePendingBreakpoints) {
		ExecuteCmd(wxT("set breakpoint pending on"));
	}

	if (m_info.catchThrow) {
		ExecuteCmd(wxT("catch throw"));
	}

#ifdef __WXMSW__
	if (m_info.debugAsserts) {
		ExecuteCmd(wxT("break assert"));
	}
#endif

	ExecuteCmd(wxT("set width 0"));
	ExecuteCmd(wxT("set height 0"));
	ExecuteCmd(wxT("set print pretty on"));  // pretty printing

	// Number of elements to show for arrays (including strings)
	wxString sizeCommand;
	sizeCommand << wxT("set print elements ") << m_info.maxDisplayStringSize;
	ExecuteCmd( sizeCommand );

	// set the project startup commands
	for (size_t i=0; i<cmds.GetCount(); i++) {
		ExecuteCmd(cmds.Item(i));
	}

	// keep the list of breakpoints
	m_bpList = bpList;
	
	if(GetIsRemoteDebugging() == false) 
		// When remote debugging, apply the breakpoints after we connect the 
		// gdbserver
		SetBreakpoints();

	if (m_info.breakAtWinMain) {
		//try also to set breakpoint at WinMain
		WriteCommand(wxT("-break-insert main"), NULL);
	}
	return true;
}
开发者ID:RVictor,项目名称:EmbeddedLite,代码行数:50,代码来源:debuggergdb.cpp

示例4: emmc_format

/***********************************************************************
*@函数名称: emmc_format
*@功能描述: 格式化emmc
*@参数: 	无
*@返回:		无
*@备注:	   本u-boot未使用该函数
 **********************************************************************/
void emmc_format(void)
{
    unsigned char select;
    printf("\n\nEnter 'y' to ensure erase emmc\n\n\n");
    select = getc();
    if((select == 'y') || (select == 'Y'))	{
        ExecuteCmd("ext2format mmc 0:1");
        ExecuteCmd("ext2format mmc 0:2");
        ExecuteCmd("ext2format mmc 0:3");
        printf("\n\nformat complete !!!\n\n");
    }
    else {
        printf("\nformat abort !!!\n\n");
    }
}
开发者ID:advx9600,项目名称:uboot-4.4-RuiEr,代码行数:22,代码来源:real_menu.c

示例5: OnSetConsoleKeyShortcuts

// Undocumented function
BOOL WINAPI OnSetConsoleKeyShortcuts(BOOL bSet, BYTE bReserveKeys, LPVOID p1, DWORD n1)
{
	//typedef BOOL (WINAPI* OnSetConsoleKeyShortcuts_t)(BOOL,BYTE,LPVOID,DWORD);
	ORIGINALFASTEX(SetConsoleKeyShortcuts,NULL);
	BOOL lbRc = FALSE;

	if (F(SetConsoleKeyShortcuts))
		lbRc = F(SetConsoleKeyShortcuts)(bSet, bReserveKeys, p1, n1);

	if (ghConEmuWnd && IsWindow(ghConEmuWnd))
	{
		DWORD nLastErr = GetLastError();
		DWORD nSize = sizeof(CESERVER_REQ_HDR)+sizeof(BYTE)*2;
		CESERVER_REQ *pIn = ExecuteNewCmd(CECMD_KEYSHORTCUTS, nSize);
		if (pIn)
		{
			pIn->Data[0] = bSet;
			pIn->Data[1] = bReserveKeys;

			wchar_t szGuiPipeName[128];
			msprintf(szGuiPipeName, countof(szGuiPipeName), CEGUIPIPENAME, L".", LODWORD(ghConWnd));

			CESERVER_REQ* pOut = ExecuteCmd(szGuiPipeName, pIn, 1000, NULL);

			if (pOut)
				ExecuteFreeResult(pOut);
			ExecuteFreeResult(pIn);
		}
		SetLastError(nLastErr);
	}

	return lbRc;
}
开发者ID:VladimirTyrin,项目名称:ConEmu,代码行数:34,代码来源:hkConsole.cpp

示例6: CorrectGuiChildRect

void CorrectGuiChildRect(DWORD anStyle, DWORD anStyleEx, RECT& rcGui)
{
	RECT rcShift = {};

	if ((anStyle != gGuiClientStyles.nStyle) || (anStyleEx != gGuiClientStyles.nStyleEx))
	{
		DWORD nSize = sizeof(CESERVER_REQ_HDR)+sizeof(GuiStylesAndShifts);
		CESERVER_REQ *pIn = ExecuteNewCmd(CECMD_GUICLIENTSHIFT, nSize);
		if (pIn)
		{
			pIn->GuiAppShifts.nStyle = anStyle;
			pIn->GuiAppShifts.nStyleEx = anStyleEx;
			wchar_t szOurExe[MAX_PATH*2] = L"";
			GetModuleFileName(NULL, szOurExe, countof(szOurExe));
			lstrcpyn(pIn->GuiAppShifts.szExeName, PointToName(szOurExe), countof(pIn->GuiAppShifts.szExeName));

			wchar_t szGuiPipeName[128];
			msprintf(szGuiPipeName, countof(szGuiPipeName), CEGUIPIPENAME, L".", (DWORD)ghConEmuWnd);

			CESERVER_REQ* pOut = ExecuteCmd(szGuiPipeName, pIn, 10000, NULL);
			if (pOut)
			{
				gGuiClientStyles = pOut->GuiAppShifts;
				ExecuteFreeResult(pOut);
			}
			ExecuteFreeResult(pIn);
		}
	}

	rcShift = gGuiClientStyles.Shifts;

	rcGui.left += rcShift.left; rcGui.top += rcShift.top;
	rcGui.right += rcShift.right; rcGui.bottom += rcShift.bottom;
}
开发者ID:rheostat2718,项目名称:conemu-maximus5,代码行数:34,代码来源:GuiAttach.cpp

示例7: HandleRecData

/******************************************************************
** 函数名: HandleRecData
** 输  入: 无
** 描  述: 处理串口接收到的数据
**                                                                  
** 全局变量: 
** 调用模块: 
** 作  者:   zcs
** 日  期:   2015-04-21
** 修  改:
** 日  期:

** 版  本: 1.0
*******************************************************************/
void HandleRecData(void)
{
	if (WorkQueueData(&Queue,&get_whole_data)) //判定接收到的指令是否匹配正确,若正确则继续运行,否则退出
	{
		ExecuteCmd(PretreatBuffer);
	}
}
开发者ID:joyceandpig,项目名称:Acupuncture,代码行数:21,代码来源:configure_init.c

示例8: MakeId

bool DbgGdb::WriteCommand( const wxString &command, DbgCmdHandler *handler )
{
    wxString cmd;
    wxString id = MakeId( );
    cmd << id << command;

    if ( !ExecuteCmd( cmd ) ) {
        return false;
    }
    RegisterHandler( id, handler );
    return true;
}
开发者ID:LoviPanda,项目名称:codelite,代码行数:12,代码来源:debuggergdb.cpp

示例9: RegDeleteKey

//安装驱动
BOOL VirtualDrive::InstallDriver()
{
	if (!IsISOCmdExist())
	{
		return FALSE;
	}
	//清理旧驱动信息
	CString subPath= L"SYSTEM\\CurrentControlSet\\Services\\ISODrive";
	RegDeleteKey(HKEY_LOCAL_MACHINE,subPath);
	//安装新驱动
	ExecuteCmd(L"CMD /C ISOCmd -Install",m_CurrentISOCmdDirectory);
	//设定盘符数量
	ExecuteCmd(L"CMD /C ISOCmd -Number 1",m_CurrentISOCmdDirectory);
	//获取当前盘符
	m_DrivrName=GetDriveName();
	if (!IsDriveLoadSuccess())
	{
		return FALSE;
	}
	return TRUE;
}
开发者ID:Tevic,项目名称:ISOCmdX,代码行数:22,代码来源:VirtualDrive.cpp

示例10: ExecuteCmd

//加载镜像
BOOL VirtualDrive::Mount(CString csImagePath)
{
	//m_DriveNameArray.Add(csImagePath);
	//CHAR chDriveLabel[10];
	//_itoa_s(m_DriveNameArray.GetCount()-1,chDriveLabel,10);
	//ExecuteCmd(L"CMD /C ISOCmd -Mount "+CString(chDriveLabel)+L": \""+csImagePath+L"\"",m_CurrentISOCmdDirectory);
	ExecuteCmd(L"CMD /C ISOCmd -Mount 0: \""+csImagePath+L"\"",m_CurrentISOCmdDirectory);
	//ExecuteCmdAsyn(L"ISOCmd -Mount 0: \""+csImagePath+L"\"",m_CurrentISOCmdDirectory);
	SHChangeNotify (SHCNE_DRIVEADD, SHCNF_PATH, m_DrivrName, NULL);
	m_DriveState=TRUE;
	return TRUE;
}
开发者ID:Tevic,项目名称:ISOCmdX,代码行数:13,代码来源:VirtualDrive.cpp

示例11: _itoa_s

//卸载镜像
BOOL VirtualDrive::UnMount()
{
	CHAR chDriveLabel[10];
	_itoa_s(m_DriveNameArray.GetCount()-1,chDriveLabel,10);
	//ExecuteCmdAsyn(L"ISOCmd -Eject "+CString(chDriveLabel)+L":",m_CurrentISOCmdDirectory);
	ExecuteCmd(L"CMD /C ISOCmd -Eject 0:",m_CurrentISOCmdDirectory);
	SHChangeNotify (SHCNE_DRIVEREMOVED, SHCNF_PATH, m_DrivrName, NULL);
	m_DriveState=FALSE;
	//此处必须有否则驱动卸载不完全
	Sleep(500);
	return TRUE;
}
开发者ID:Tevic,项目名称:ISOCmdX,代码行数:13,代码来源:VirtualDrive.cpp

示例12: GuiMessageBox

int GuiMessageBox(HWND hConEmuWndRoot, LPCWSTR asText, LPCWSTR asTitle, int anBtns)
{
	int nResult = 0;
	
	if (hConEmuWndRoot)
	{
		HWND hConWnd = myGetConsoleWindow();
		CESERVER_REQ *pIn = (CESERVER_REQ*)malloc(sizeof(*pIn));
		ExecutePrepareCmd(pIn, CECMD_ASSERT, sizeof(CESERVER_REQ_HDR)+sizeof(MyAssertInfo));
		pIn->AssertInfo.nBtns = anBtns;
		_wcscpyn_c(pIn->AssertInfo.szTitle, countof(pIn->AssertInfo.szTitle), asTitle, countof(pIn->AssertInfo.szTitle)); //-V501
		_wcscpyn_c(pIn->AssertInfo.szDebugInfo, countof(pIn->AssertInfo.szDebugInfo), asText, countof(pIn->AssertInfo.szDebugInfo)); //-V501

		wchar_t szGuiPipeName[128];
		msprintf(szGuiPipeName, countof(szGuiPipeName), CEGUIPIPENAME, L".", (DWORD)hConEmuWndRoot); //-V205

		CESERVER_REQ* pOut = ExecuteCmd(szGuiPipeName, pIn, 1000, hConWnd);

		free(pIn);

		if (pOut)
		{
			if (pOut->hdr.cbSize > sizeof(CESERVER_REQ_HDR))
			{
				nResult = pOut->dwData[0];
			}
			ExecuteFreeResult(pOut);
		}
	}
	else
	{
		//_ASSERTE(hConEmuWndRoot!=NULL);
		// Избежать статической линковки к user32
		HMODULE hUser32 = GetModuleHandle(L"User32.dll");
		if (hUser32 == NULL)
			hUser32 = LoadLibrary(L"User32.dll");
		typedef int (WINAPI* MessageBoxW_T)(HWND, LPCWSTR, LPCWSTR, UINT);
		MessageBoxW_T _MessageBoxW = hUser32 ? (MessageBoxW_T)GetProcAddress(hUser32, "MessageBoxW") : NULL;
		if (_MessageBoxW)
		{
			nResult = _MessageBoxW(NULL, asText, asTitle, MB_SYSTEMMODAL|anBtns);
		}
		else
		{
			#ifdef _DEBUG
			_CrtDbgBreak();
			#endif
		}
	}

	return nResult;
}
开发者ID:alexlav,项目名称:conemu,代码行数:52,代码来源:ConEmuCheck.cpp

示例13: realarm_sdfuse

/***********************************************************************
*@函数名称: realarm_sdfuse
*@功能描述: sdfuse菜单显示和功能选择
*@参数: 	无
*@返回:		无
*@备注:	   	无
 **********************************************************************/
void realarm_sdfuse(void)
{
    unsigned char select;
    while(1)
    {
        printf("\n#**** Select the fuction ****#\n");
        printf("[1] Flash all image\n");
        printf("[2] Flash u-boot\n");
        printf("[3] Flash boot\n");
        printf("[4] Flash system\n");
        printf("[5] Flash cache\n");
        printf("[6] Flash userdata\n");
        printf("[7] Exit\n");
        printf("Enter your Selection:");

        select = getc();
        printf("%c\n", select >= ' ' && select <= 127 ? select : ' ');
        switch(select)
        {
        case '1':
            ExecuteCmd("sdfuse flash all");

            break;

        case '2':
            ExecuteCmd("sdfuse flash 2ndboot");
            ExecuteCmd("sdfuse flash u-boot");

            break;

        case '3':
            ExecuteCmd("sdfuse flash boot");

            break;
        case '4':
            ExecuteCmd("sdfuse flash system");

            break;
        case '5':
            ExecuteCmd("sdfuse flash cache");

            break;
        case '6':
            ExecuteCmd("sdfuse flash userdata");

            break;
        case '7':
            return;

        default:
            break;
        }
    }
}
开发者ID:advx9600,项目名称:uboot-4.4-RuiEr,代码行数:61,代码来源:real_menu.c

示例14: ExecuteHkCmd

// Выполнить в ConEmuHk
CESERVER_REQ* ExecuteHkCmd(DWORD dwHkPID, CESERVER_REQ* pIn, HWND hOwner)
{
	wchar_t szPipeName[128];

	if (!dwHkPID)
		return NULL;

	DWORD nLastErr = GetLastError();
	//_wsprintf(szPipeName, SKIPLEN(countof(szPipeName)) CESERVERPIPENAME, L".", (DWORD)dwSrvPID);
	msprintf(szPipeName, countof(szPipeName), CEHOOKSPIPENAME, L".", (DWORD)dwHkPID);
	CESERVER_REQ* lpRet = ExecuteCmd(szPipeName, pIn, 1000, hOwner);
	SetLastError(nLastErr); // Чтобы не мешать процессу своими возможными ошибками общения с пайпом
	return lpRet;
}
开发者ID:alexlav,项目名称:conemu,代码行数:15,代码来源:ConEmuCheck.cpp

示例15: ExecuteSrvCmd

// Выполнить в ConEmuC
CESERVER_REQ* ExecuteSrvCmd(DWORD dwSrvPID, CESERVER_REQ* pIn, HWND hOwner, BOOL bAsyncNoResult, DWORD nTimeout /*= 0*/)
{
	wchar_t szPipeName[128];

	if (!dwSrvPID)
		return NULL;

	DWORD nLastErr = GetLastError();
	//_wsprintf(szPipeName, SKIPLEN(countof(szPipeName)) CESERVERPIPENAME, L".", (DWORD)dwSrvPID);
	msprintf(szPipeName, countof(szPipeName), CESERVERPIPENAME, L".", (DWORD)dwSrvPID);
	CESERVER_REQ* lpRet = ExecuteCmd(szPipeName, pIn, nTimeout, hOwner, bAsyncNoResult, dwSrvPID);
	_ASSERTE(pIn->hdr.bAsync == bAsyncNoResult);
	SetLastError(nLastErr); // Чтобы не мешать процессу своими возможными ошибками общения с пайпом
	return lpRet;
}
开发者ID:alexlav,项目名称:conemu,代码行数:16,代码来源:ConEmuCheck.cpp


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