0

Windows フォーム アプリケーションにサポートを追加して、パラメーターを使用して起動できるようにするにはどうすればよいですか?

私はC++を使用しています。

4

3 に答える 3

0

argsMain メソッドに配列を追加するか、使用することができますEnvironment::GetCommandLineArgs()

だからどちらか

int Main(array<String^>^ args)

また

array<String^>^ args = Environment::GetCommandLineArgs();

次に、args 配列をループして、配列の内容に基づいて何をすべきかを決定します。

于 2012-10-30T19:44:43.337 に答える
0

If you are writing Win32 gui application then your entry point it WinMain:

int CALLBACK WinMain(
  _In_  HINSTANCE hInstance,
  _In_  HINSTANCE hPrevInstance,
  _In_  LPSTR lpCmdLine,
  _In_  int nCmdShow
);

The third parameter, lpCmdLine is the command line passed to the application. The command line parameters passed to the application will be in that string.

于 2012-10-31T17:00:11.170 に答える
0

main(int argc, char** argv)実行可能プログラムには関数があります。渡されたコマンド ライン パラメータを解析し、argvこれらをメイン フォームに渡すだけです。

于 2012-10-30T19:46:43.783 に答える