visualc&x2B+;2010 Express使用命令行参数 我是Visual C++ 2010的新手,但我正在研究它。我使用向导创建了一个包含main和Form1部分的winform项目。到目前为止,这个程序运行得非常完美。现在我想在启动应用程序时使用一些命令行参数

visualc&x2B+;2010 Express使用命令行参数 我是Visual C++ 2010的新手,但我正在研究它。我使用向导创建了一个包含main和Form1部分的winform项目。到目前为止,这个程序运行得非常完美。现在我想在启动应用程序时使用一些命令行参数,c++,winforms,visual-studio-2010,command-line-arguments,C++,Winforms,Visual Studio 2010,Command Line Arguments,向导创建了以下主代码: ;using namespace HVBackup2012; [STAThreadAttribute] int main(array<System::String ^> ^args) { // Aktivieren visueller Effekte von Windows XP, bevor Steuerelemente erstellt werden Application::EnableVisualStyles(); App

向导创建了以下主代码:

;using namespace HVBackup2012;

[STAThreadAttribute]

int main(array<System::String ^> ^args)

{
    // Aktivieren visueller Effekte von Windows XP, bevor Steuerelemente erstellt werden
    Application::EnableVisualStyles();
    Application::SetCompatibleTextRenderingDefault(false); 

    // Hauptfenster erstellen und ausführen
    Application::Run(gcnew Form1());
    return 0;
}
;使用名称空间HVBackup2012;
[属性]
int main(数组^args)
{
//Windows XP的视觉效果,bevor Steueremente erstellt werden
Application::EnableVisualStyles();
Application::SetCompatibleTextRenderingDefault(false);
//厄斯泰伦和奥斯弗伦酒店
应用程序::运行(gcnewform1());
返回0;
}
但我不知道,如何处理args并将其交给Form1进行处理?我在互联网上根本找不到这个主要结构,但它必须是默认的?我不反对这场战争

(array<System::String ^> ^args).
(数组^args)。
谢谢你的帮助


Lex

托管C++(或C++ +CLI)可能不是学习C++或VisualStudio的最佳方法。如果你不与C++绑定,而是想使用Windows窗体,那么使用像VB或C语言这样的管理语言(我推荐C++)会容易得多。在Form1类中添加一个。