草庐IT

what-does-the-optimize-switch-do

全部标签

c++ - _popen : do not show the shell window (SW_HIDE)

当我在c++mfc中执行_popen命令时,它会打开一个我不喜欢的shell窗口,是否可以将其隐藏?例如,当您尝试使用ShellExecute函数执行命令时,它可以选择使用SW_HIDE隐藏shell窗口。 最佳答案 注释来自documentation:如果在Windows程序中使用,_popen函数会返回一个无效的文件指针,导致程序无限期地停止响应。_popen在控制台应用程序中正常工作。要创建重定向输入和输出的Windows应用程序,请参阅CreatingaChildProcesswithRedirectedInputandOu

windows - 错误 1053 : The service did not respond to the start or control request in a timely fashion

我有一个可执行文件,我想将其设置为作为服务运行。使用windows提供的sc.exe工具(见知识库文章:http://support.microsoft.com/kb/251192),我成功“注册”了服务。但是,当我转到服务管理控制台(开始->运行->services.msc)并启动服务时,出现以下错误:错误1053:服务没有及时响应启动或控制请求。阅读之后,我的初步印象是服务可执行文件必须符合API,并且服务必须响应的必需功能/方法包括启动/停止/重新启动命令。然而,这似乎违背了sc.exe工具的全部意义,该工具被宣传能够将任何可执行文件转换为服务。任何人都可以为我阐明这一点吗?

Windows PowerShell : How to do standard-in redirection & passing parameters to commands properly?

我得到了一个.patch文件,我必须将其应用于某些源代码。不幸的是,我在Windows上运行。所以我从http://gnuwin32.sourceforge.net/packages/patch.htm安装了补丁程序的Windows端口并启动了PowerShell。但我没有完成,它总是以错误告终。(除了GnuWin32没有安装在“路径”中的事实之外...)第一次尝试:PSD:\eclipsews\fix17435>"C:\ProgramFiles(x86)\GnuWin32\bin\patch.exe"是的,我的PowerShell能说一口流利的德语,因此通过google搜索错误消息不

c - SetupDiGetDeviceRegistryProperty : "The data area passed to a system call is too small" error

我有一个使用SetupAPI在WindowsXP上枚举USB设备的代码:HDEVINFOhDevInfo=SetupDiGetClassDevs(&_DEVINTERFACE_USB_DEVICE,0,0,DIGCF_DEVICEINTERFACE|DIGCF_PRESENT);for(DWORDi=0;;++i){SP_DEVINFO_DATAdevInfo;devInfo.cbSize=sizeof(SP_DEVINFO_DATA);BOOLsucc=SetupDiEnumDeviceInfo(hDevInfo,i,&devInfo);if(GetLastError()==ERRO

windows - Grunt/Batch : how to execute shell commands within the gruntfile. js目录?

我知道这是一个常见问题,但我尝试过的所有答案均无效。奇怪的是,一位friend在他的Windows上尝试了这个脚本,实际上得到了当前目录(包含gruntfile.js的目录)。我试图查看差异,但也没有发现任何差异。module.exports=function(grunt){grunt.initConfig({pkg:grunt.file.readJSON('package.json'),shell:{test:{command:'dir'}}});grunt.loadNpmTasks('grunt-shell');};这是我得到的:D:\Websites\AUB>gruntshell

windows - 导入模块 : The specified module 'msonline' was not loaded because no valid module file was found in any module directory

错误:Import-Module:Thespecifiedmodule'msonline'wasnotloadedbecausenovalidmodulefilewasfoundinanymoduledirectory当我尝试通过键入加载模块时弹出错误:Import-ModuleMSOnline尝试在我的计算机上安装AzureADpowershell模块,以便我能够使用MSONLINEcmdlet创建PSSession。在我安装了MicrosoftOnlineServices登录助手(版本7.250.4556.0),然后安装了适用于WindowsPowershell的最新Windows

windows - nvcc 致命 : Compiler 'cl.exe' in PATH different than the one specified with -ccbin

我已经在Windows7-SP1上安装了CUDA7.5,并且正在使用VisualStudio2013。不幸的是,我无法运行任何CUDA代码。我什至无法构建示例bandwidthTest。我收到以下错误:C:\ProgramData\NVIDIACorporation\CUDASamples\v7.5\1_Utilities\bandwidthTest>"C:\ProgramFiles\NVIDIAGPUComputingToolkit\CUDA\v7.5\bin\nvcc.exe"-gencode=arch=compute_20,code=\"sm_20,compute_20\"-ge

windows - 批处理脚本 : Why does this condition evaluate to true?

创建一个包含以下内容的批处理文件:@echooffsetlocalecho%1if[%1]==[]echohi然后像这样从命令提示符运行它:script.cmd==输出结果如下:ECHOisoff.hi这是为什么,它是如何发生的?另外,如何更可靠地检查批处理脚本中的空字符串?谢谢。 最佳答案 在这种情况下,我建议使用以下内容:@echooffsetlocalecho(%~1if"%~1"==""echohi而不是script.cmd==使用script.cmd"=="请注意,我使用了echo(,如果变量被视为空,它将回显一个换行符,

windows - Sonar : The 'report' parameter is missing

我正在使用MSBuild。我安装了Java8。我正在运行以下命令:SonarQube.Scanner.MSBuild.exebegin/k:"ABC"/d:sonar.host.url="http://localhost:9000"/d:sonar.login="8b839xxxxxxxxxxxxxxxxxxxxxxx6b00125bf92"/d:sonar.verbose=true"C:\ProgramFiles(x86)\MicrosoftVisualStudio\2017\Professional\MSBuild\15.0\Bin\msbuild.exe"/t:rebuildSo

windows - Windows 上的 perl : Can't do inplace edit on file: File exists

我已经读过this和this问题,这让我想到:forfin*.Xmldoperl-pi.bak-e's/\x03//g'"$f"donerm*.bak我正在使用for循环并且我正在使用-pi.bak。我仍然得到Can'tdoinplaceediton20180619.Xml:Fileexists.。我还从Windows的cmd.exe而不是gitbash尝试了这个:for%iin(*.Xml)doperl-pi.bak-e"s/\x03//g""%i"同样的事情。有什么想法吗?版本信息:$perl--versionThisisperl5,version26,subversion1(v5