Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » Developing U++ » U++ Developers corner » How does one get argc and argv parms when making use of GUI_APP_MAIN?
How does one get argc and argv parms when making use of GUI_APP_MAIN? [message #56785] Fri, 16 April 2021 04:52 Go to next message
ptkacz is currently offline  ptkacz
Messages: 89
Registered: March 2017
Member
> How does one get argc and argv parms when making use of GUI_APP_MAIN?

Ok, I did some digging and there appears to be a CommandLine() function that returns a Vector<String>&. When I run the program from command line, the following returns a value of ZERO:

const Vector<String>& argc = CommandLine();

cout << "argc = " << to_string(argc.GetCount()) << endl;


In a C or C++ program with main(int argc, char **argv) provided, and the program is launched with no arguments, argc returns a value of 1, so why does the count for the String Vector for CommandLine() come back as ZERO?


Peter

[Updated on: Fri, 16 April 2021 05:21]

Report message to a moderator

Re: How does one get argc and argv parms when making use of GUI_APP_MAIN? [message #56788 is a reply to message #56785] Fri, 16 April 2021 06:20 Go to previous messageGo to next message
Novo is currently offline  Novo
Messages: 1363
Registered: December 2006
Ultimate Contributor
U++ intentionally skips argv[0].

Regards,
Novo
Re: How does one get argc and argv parms when making use of GUI_APP_MAIN? [message #56829 is a reply to message #56788] Sun, 18 April 2021 04:49 Go to previous message
Novo is currently offline  Novo
Messages: 1363
Registered: December 2006
Ultimate Contributor
Function String GetArgv0() was added to U++ today ...

Regards,
Novo
Previous Topic: UppHub - new package registration
Next Topic: [Proposal] Markdown to QTF converter/parser
Goto Forum:
  


Current Time: Wed Jun 19 07:14:41 CEST 2024

Total time taken to generate the page: 0.04056 seconds