Watch, Follow, &
Connect with Us

For forums, blogs and more please visit our
Developer Tools Community.


Welcome, Guest
Guest Settings
Help

Thread: Firemonkey and main() question



Permlink Replies: 2 - Last Post: Dec 1, 2017 12:44 PM Last Post By: Ulmo Voda Threads: [ Previous | Next ]
Ulmo Voda

Posts: 5
Registered: 10/22/17
Firemonkey and main() question
Click to report abuse...   Click to reply to this thread Reply
  Posted: Dec 1, 2017 10:58 AM
I want separate my app code from FM UI and I don't know where is the main() function.
In my project I found only this autogenerated file with this code:
#pragma hdrstop
#include <System.StartUpCopy.hpp>
//---------------------------------------------------------------------------
USEFORM("Unit2.cpp", Form2);
//---------------------------------------------------------------------------
extern "C" int FMXmain()
{
	try
	{
		Application->Initialize();
		Application->CreateForm(__classid(TForm2), &Form2);
		Application->Run();
	}
	catch (Exception &exception)
	{
		Application->ShowException(&exception);
	}
	catch (...)
	{
		try
		{
			throw Exception("");
		}
		catch (Exception &exception)
		{
			Application->ShowException(&exception);
		}
	}
 
	return 0;

Is it main function? It is looks like only main for FM but not as overall main function, or I am wrong?


Another question is there some tutorials or documentation for it? I mean not for FM ui, because I find those tutorials on documentation but nothing about this like main() and where is the place for separate code for app or how is Firemonkey builded as code and how it works.

Remy Lebeau (Te...


Posts: 9,447
Registered: 12/23/01
Re: Firemonkey and main() question
Click to report abuse...   Click to reply to this thread Reply
  Posted: Dec 1, 2017 11:12 AM   in response to: Ulmo Voda in response to: Ulmo Voda
Ulmo Voda wrote:

I want separate my app code from FM UI and I don't know where is the
main() function.

It is the FMXmain() function that you showed. "main" is just a naming
convention, it is not actually required to be named "main", it can be
whatever the vendor's RTL wants it to be named.

Is it main function?

Yes.

--
Remy Lebeau (TeamB)
Ulmo Voda

Posts: 5
Registered: 10/22/17
Re: Firemonkey and main() question
Click to report abuse...   Click to reply to this thread Reply
  Posted: Dec 1, 2017 12:44 PM   in response to: Remy Lebeau (Te... in response to: Remy Lebeau (Te...
Thanks.
Legend
Helpful Answer (5 pts)
Correct Answer (10 pts)

Server Response from: ETNAJIVE02