在vc ++中传递命令行参数 [英] passing Command line args in vc++

查看:290
本文介绍了在vc ++中传递命令行参数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,

我正在VC ++中创建基于对话框的应用程序(exe).我的要求是在运行exe时将字符串值传递给应用程序,这可能吗?提前谢谢.

问候,
Anil

Hi all,

I am creating dialog based application(exe) in VC++. My requirement is to pass a string value to the application while running the exe, is it possible to do this? Thanks in advance.

Regards,
Anil

推荐答案

您可以为基于对话框的应用程序传递命令行参数.
在应用程序中,您可以使用 GetCommandLine [ ^ ]和CommandLineToArgvW [
You can pass in the command line arguments for a dialog based application.
In the application you can access it using the GetCommandLine[^] and CommandLineToArgvW[^] functions.


谢谢.

我找到了一个更好的解决方案.我们为Application类提供了一个成员变量,如 m_lpCmdLine .它将提供命令行参数.希望这对其他人有帮助:)
Thank you guys.

I found one better solution of this. we have one member variable like m_lpCmdLine for Application class. it will give the command line arguments. hope this will help others :)


这篇关于在vc ++中传递命令行参数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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