| View previous topic :: View next topic |
| Author |
Message |
bmkiss Guest
|
Posted: Fri Dec 22, 2006 12:56 am Post subject: How do I pass an arguement into a form. |
|
|
How would I pass an arguement, from the command line, into a form? |
|
| Back to top |
|
 |
bmkiss Guest
|
Posted: Fri Dec 22, 2006 1:33 am Post subject: Re: How do I pass an arguement into a form. |
|
|
I should probably give more info so this makes more sense. From WinMain I
want to be able to pass wahtever is sitting in LPSTR and pass it into the
main form or in the case of the example below into TForm1. I hope that
makes more sense now.
WINAPI WinMain(HINSTANCE, HINSTANCE, LPSTR, int)
{
try
{
Application->Initialize();
Application->CreateForm(__classid(TForm1), &Form1);
Application->Run();
"bmkiss" <bmkiss67 (AT) cablespeed (DOT) com> wrote in message
news:458ad85c$1 (AT) newsgroups (DOT) borland.com...
| Quote: | How would I pass an arguement, from the command line, into a form?
|
|
|
| Back to top |
|
 |
Hans Galema Guest
|
Posted: Fri Dec 22, 2006 1:38 am Post subject: Re: How do I pass an arguement into a form. |
|
|
bmkiss wrote:
| Quote: | I should probably give more info so this makes more sense. From WinMain I
want to be able to pass wahtever is sitting in LPSTR and pass it into the
main form or in the case of the example below into TForm1. I hope that
makes more sense now.
WINAPI WinMain(HINSTANCE, HINSTANCE, LPSTR, int)
|
Well you do not need to as everywhere in your program -and so
also in Form1- you can get the parameterstrings with
ParamStr(0);
ParamStr(1);
Use ParamCount to see how far you can go.
Also the old c-style argc and argv[] still work too.
Hans. |
|
| Back to top |
|
 |
bmkiss Guest
|
Posted: Fri Dec 22, 2006 2:51 am Post subject: Re: How do I pass an arguement into a form. |
|
|
That worked great. Thanks a lot for the help.
"Hans Galema" <notused (AT) notused (DOT) nl> wrote in message
news:458ae34d (AT) newsgroups (DOT) borland.com...
| Quote: | bmkiss wrote:
I should probably give more info so this makes more sense. From WinMain
I want to be able to pass wahtever is sitting in LPSTR and pass it into
the main form or in the case of the example below into TForm1. I hope
that makes more sense now.
WINAPI WinMain(HINSTANCE, HINSTANCE, LPSTR, int)
Well you do not need to as everywhere in your program -and so
also in Form1- you can get the parameterstrings with
ParamStr(0);
ParamStr(1);
Use ParamCount to see how far you can go.
Also the old c-style argc and argv[] still work too.
Hans. |
|
|
| Back to top |
|
 |
Remy Lebeau (TeamB) Guest
|
Posted: Fri Dec 22, 2006 4:27 am Post subject: Re: How do I pass an arguement into a form. |
|
|
"Hans Galema" <notused (AT) notused (DOT) nl> wrote in message
news:458ae34d (AT) newsgroups (DOT) borland.com...
| Quote: | Well you do not need to as everywhere in your program -and
so also in Form1- you can get the parameterstrings with
ParamStr(0);
ParamStr(1);
Use ParamCount to see how far you can go.
|
Something to keep in mind - ParamStr() and ParamCount() have bugs in them
that actually skip certain kinds of valid parameters (see QC #27451 for
details).
Gambit |
|
| Back to top |
|
 |
Fraser Ross Guest
|
Posted: Fri Dec 22, 2006 9:54 pm Post subject: Re: How do I pass an arguement into a form. |
|
|
"bmkiss"
| Quote: | Also the old c-style argc and argv[] still work too.
Hans.
|
Outside of the main function _argc and _argv can be used in a Windows
program.
Fraser. |
|
| Back to top |
|
 |
|