BorlandTalk.com Forum Index BorlandTalk.com
Borland discussion newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

How do I pass an arguement into a form.

 
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> C++ Builder (Language C++)
View previous topic :: View next topic  
Author Message
bmkiss
Guest





PostPosted: Fri Dec 22, 2006 12:56 am    Post subject: How do I pass an arguement into a form. Reply with quote



How would I pass an arguement, from the command line, into a form?
Back to top
bmkiss
Guest





PostPosted: Fri Dec 22, 2006 1:33 am    Post subject: Re: How do I pass an arguement into a form. Reply with 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)
{
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





PostPosted: Fri Dec 22, 2006 1:38 am    Post subject: Re: How do I pass an arguement into a form. Reply with quote



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





PostPosted: Fri Dec 22, 2006 2:51 am    Post subject: Re: How do I pass an arguement into a form. Reply with quote

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





PostPosted: Fri Dec 22, 2006 4:27 am    Post subject: Re: How do I pass an arguement into a form. Reply with quote

"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





PostPosted: Fri Dec 22, 2006 9:54 pm    Post subject: Re: How do I pass an arguement into a form. Reply with quote

"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
Display posts from previous:   
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> C++ Builder (Language C++) All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.