|
|
Home » U++ Library support » U++ Library : Other (not classified elsewhere) » access to raw command line parameters
|
Re: access to raw command line parameters [message #3874 is a reply to message #3869] |
Wed, 05 July 2006 09:03 |
fallingdutch
Messages: 258 Registered: July 2006
|
Experienced Member |
|
|
dr_jumba wrote on Tue, 04 July 2006 18:21 | Is there exist an easy way to access to command line parameters passed to GUI_APP?
|
yes, as far as i can see you get them by calling "CommandLine()" it returns a Vector of Strings (Vector<String> &)
dr_jumba wrote on Tue, 04 July 2006 18:21 | What I need is to pass these parameters to 3rd party library init function.
E.g.
SuperLibInit(argc, argv);
|
I am not sure, but take a look at dli (Core/dli.h, Core/Dli.cpp) in the "Win32 support" section of Core.
As far as i know you can even load .so at *nix OS, using these files, but not sure.
If you have a solution for this please poste it, working on it, too
Bas
|
|
|
Re: access to raw command line parameters [message #3875 is a reply to message #3869] |
Wed, 05 July 2006 09:04 |
|
dr_jumba wrote on Tue, 04 July 2006 12:21 | Hi,
Is there exist an easy way to access to command line parameters passed to GUI_APP?
What I need is to pass these parameters to 3rd party library init function.
E.g.
SuperLibInit(argc, argv);
Thanks.
|
It seems there is no way to access that variables directly, but you can get command line parameters into string vector using CommnadLine() function:
const Vector<String> &cmd = CommandLine();
int cnt = cmd.GetCount();
const char **argv = new const char*[cnt];
for(int i = 0; i < cnt; i++)
argv[i] = cmd[i];
SuperLibInit(cnt, argv);
|
|
|
Re: access to raw command line parameters [message #3911 is a reply to message #3875] |
Sat, 08 July 2006 22:08 |
Werner
Messages: 234 Registered: May 2006 Location: Cologne / Germany
|
Experienced Member |
|
|
unodgs wrote on Wed, 05 July 2006 09:04 |
dr_jumba wrote on Tue, 04 July 2006 12:21 | Hi,
Is there exist an easy way to access to command line parameters passed to GUI_APP?
What I need is to pass these parameters to 3rd party library init function.
E.g.
SuperLibInit(argc, argv);
Thanks.
|
It seems there is no way to access that variables directly, but you can get command line parameters into string vector using CommnadLine() function:
const Vector<String> &cmd = CommandLine();
int cnt = cmd.GetCount();
const char **argv = new const char*[cnt];
for(int i = 0; i < cnt; i++)
argv[i] = cmd[i];
SuperLibInit(cnt, argv);
|
If the above code doesn't help (it doesn't comply with the C++ standard ) you might want to have a look at my recent posting "ArgcArgv – use argc and argv under Ultimate++!" (Home » Extra libraries, Code snippets, applications etc. » U++ users applications in progress and useful code snippets, including reference examples!)
Werner
|
|
|
|
|
Goto Forum:
Current Time: Tue Apr 30 17:07:26 CEST 2024
Total time taken to generate the page: 0.03481 seconds
|
|
|