This recipe follows the official approach and uses two different projects (one from VCL and one from FireMonkey) to use the FireMonkey framework from a VCL application.
What if you have a legacy project where you'd like to use a FireMonkey DLL, but the legacy project is not in Delphi VCL (let's say it is in C#, Visual C++, Python, or any other language that can load a DLL)? You can still use the same approach, but you cannot use Delphi-specific data types. So, your strings should be PChar and so on. You can find more information on this at http://delphi.about.com/od/objectpascalide/a/dlldelphi.htm.
Just to be clear, keep in mind that mixing FireMonkey and VCL forms in the same application isn't officially supported. However, there are a number of libraries that aim to integrate VCL and FireMonkey forms in the same project.
Here's a short list, in no particular order:
- TFireMonkeyContainer at https://parnassus.co/open-source/tfiremonkeycontainer/
- MonkeyMixer by LaKraven Studios Ltd at https://github.com/LaKraven/MonkeyMixer
- Delphisorcery at https://bitbucket.org/sglienke/dsharp (using DSharp.Windows.FMXAdapter.pas)
In this recipe, you used a function pointer as a callback. If you want to know more about this type and other types of callback, check out the following link: http://www.delphi-central.com/callback.aspx.