I am attempting to load an FMX based dll, which includes an FMX form, from a VCL application which includes a VCL form.
Taken from Release Notes - http://docwiki.embarcadero.com/RADStudio/en/Release_Notes_for_XE2_Update_2:
To create a DLL that uses GDI+, you need to start up GDI+ from your host application instead, as follows:
For Delphi, add Winapi.GDIPOBJ to the interface section uses clause of your main form unit.
Sounds all well and good, but in practice I am now getting an access violation on exiting my VCL application. I believe this is all linked to Initializing and Freeing the GDI+ but cannot find any more information regarding this.
I have read through both these posts:
https://forums.embarcadero.com/thread.jspa?threadID=63425
Delphi XE2: Possible to instantiate a FireMonkey Form in VCL application?
Anyone else come across this? Eventually I am hoping to get our C application loading the FMX dll (and GDI+), but part of this process involves getting VCL and a FireMonkey dll to work.
This answer applies to Delphi XE2 Update 2, I don't know if things have changed with Update 3.
I started the Embarcadero thread. Starting up GDI+ from the host application isn't an option for me. So far everything is working from the DLL side without errors but nothing has been released to the outside world yet either.
If you are able to modify your C host application, you may find the MSDN GdiplusStartup() documentation useful.
====
Using FireMonkey In a DLL Without Starting GDI+ In Host Application
Add this unit to your project:
To use: