如何通过多条命令的参数在Visual Studio? [英] How to pass multiple commands arguments in visual studio?

查看:146
本文介绍了如何通过多条命令的参数在Visual Studio?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用LZMA SDK一个compession / DECOM pression项目。

I am working on a compession/decompression project using the LZMA SDK.

主程序包含一些参数,我必须用它来运行应用程序

The main program contains some arguments that I must use to run the application

要在命令行中运行它,我用:

To run it from the command line, I use :

./LzmaUtil.exe e input.elf output.elf

我使用VS 2013,所以我增加了电子in.elf out.elf 来的命令参数,我重建项目(中生成的可执行文件)但似乎没有发生的时候我preSS运行。

I'm using VS 2013 , so i have added e in.elf out.elf to the commands arguments, I rebuild the project (the executable file in generated) but nothing seems to happen when I press RUN.

请注意,我有 input.elf 在debug文件夹是在 .exe文件是present在那里,并且,标志电子用于COM preSS的文件和 output.elf 是COM pressed文件。

Note that I have the input.elf in the debug folder were the .exe is present there, and the , the flag e is used to compress the file and output.elf is the compressed file.

问题VS

主要功能包括:

int MY_CDECL main(int numArgs, const char *args[])
{
    char rs[800] = { 0 };
    int res = main2(numArgs, args, rs);
    fputs(rs, stdout);
    return res;
}

完整的源$ C ​​$ C,请访问: HTTP://www.7-zip .ORG / sdk.html

调试:

使用完全没有论据我得到:

With no arguments at all I get :

The program '[5284] LzmaUtil.exe' has exited with code 0 (0x0).

使用我已经mentionned我得到的参数:

With the arguments I have mentionned I get :

The program '[5284] LzmaUtil.exe' has exited with code 1 (0x1).

这样的东西是happenning!

so something is happenning !!!

通过在主,我得到的断点:

With breakpoint at the main I get :

numArgs 4   int
args    0x007eaca8 {0x007eacbc "E:\\1PFE\\LZMA\\LzmaUtil\\Debug\\LzmaUtil.exe"} const char * *

任何帮助将AP preciated,谢谢。

Any help will be appreciated, thanks.

推荐答案

输出是空的,因为我已经把文件中的debug文件夹,它的可执行文件的同一文件夹中。

The output was empty because i have put the file in the debug folder , it in the same folder of the executable.

但是当我把文件的父目录(解决方案文件夹),它终于奏效。

But when i put the file at the parent directory (the solution folder) it finally worked .

这是怎么工作室视觉作品!

That's how visual studio works !.

这篇关于如何通过多条命令的参数在Visual Studio?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆