Borland C++ Builder 6
WINAPI WinMain(HINSTANCE, HINSTANCE, LPSTR, int)
{
try
{
AnsiString s = ParamStr(0); // I want to pass this argument
Application->Initialize();
Application->CreateForm(__classid(TForm1), &Form1); // Can't pass here?
Application->Run(); // Can't pass here either???
}
catch (Exception &exception)
How do I pass a command line argument/parameter to Form1?
CreateForm doesn't allow overloaded constructors.
Creating forms with
CreateFormdoes not allow to pass additional arguments directly in Borland C++ Builder 6.You can solve this by creating an additional method to set the arguments:
Unit1.h
your form then can be initialized like:
Project1.cpp