Jump to content
david_navigator

FMX in VCL app - working natively ?

Recommended Posts

I just accidentally instantiated an FMX form in my VCL app and no errors were thrown (nor warnings at compile time).
 

It just seems to work. Is this a fluke or does delphi natively now support VCL & FMX forms in the same app ? 

Share this post


Link to post

Mixing of VCL and FMX together in the same project is NOT officially supported.  There are 3rd party solutions to make it work, but out of the box this is a fluke if it actually works.

  • Thanks 1

Share this post


Link to post

As far as I know you could always mix VCL with FMX only FMX.Forms has to come before VCL.Forms:

 

uses
  FMX.Forms,
  Vcl.Forms,

  ...

Edited by miab

Share this post


Link to post
2 hours ago, miab said:

As far as I know you could always mix VCL with FMX only FMX.Forms has to come before VCL.Forms:

 

uses
  FMX.Forms,
  Vcl.Forms,

  ...

The project file has no mention of FMX in it at all.

 

This is just a host VCL form in a VCL app where I mistyped a unit name i.e MyFormU rather then MyFormVCL_U and then instantiated the form thus

 

MyForm := TmyForm.Create(...);
MyForm.Showmodal;

 

It was only after running that I realised that the TmyForm being instantiated was the one from the FMX unit rather than the VCL one.

 

(If you're wondering why I have two similar units one VCL and one FMX, I'm in the process of converting a third party FMX project to VCL)

Share this post


Link to post

Indeed
 

uses
//  FMX.Forms,
  Vcl.Forms,

   ...

 

compiles in D11 too

Edited by miab

Share this post


Link to post
43 minutes ago, shineworld said:

Look at this github project on how to embedded FMX form in a VCL application:

https://github.com/vintagedave/firemonkey-container

 

https://parnassus.co/open-source/tfiremonkeycontainer/

I will try next week to embed a FMX 3D Opengl form in my VCL App...

Thanks, but I don't actually need an FMX form in my VCL app, I was just more surprised that it worked !

Share this post


Link to post

There are some very good things in FMX that I would like to have in VCL....
Migrate a full application from VCL to FMX is a nightmare and to have a way to do is not so bad.
For new projects, I will plan to TRY the FMX world.

Edited by shineworld

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×