Watch, Follow, &
Connect with Us

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


Welcome, Guest
Guest Settings
Help

Thread: Sharing TDataModule between VCL and FireMonkey applications


This question is answered.


Permlink Replies: 1 - Last Post: Sep 26, 2015 12:15 PM Last Post By: Jeff Overcash (...
Davide Rubbiani

Posts: 70
Registered: 8/15/03
Sharing TDataModule between VCL and FireMonkey applications  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Sep 26, 2015 1:41 AM
Hello,

I'm developing a project using XE8.

Due to availability of third party components I'm working on a FMX (multi platform) application for normal user GUI and a VCL application for administrative users GUI.
Both the applications could share some data modules but when I add the most simple VLC data module I developed (its composed by just two components, one TFDStanStorageBinLink and one TFDMemTable) to FMX application I get the following error :

Unit "MyDatamodule" is incompatible with the FMX framework used by the project.
Adding it may result in compilation errors or unexpected behavior. Continue ?

I read some post on the Internet and it seems that if no strictly VCL related components are used in Data Module the Data Module should be sherable between FMX and VCL applications.

I saw the {%CLASSGROUP 'Vcl.Controls.TControl'} that could be the compatibility problem between FMX and VCL.

So how should I proceed ?
I can press "Yes" and be sure that everything will work in the right way ? (so way the error message ?)
Are definitely Data Modules sherable between VCL and FMX applications ?
If yes what are the limits to be shure that a Data Module is sherable ?

Thank you,
Davide

Jeff Overcash (...

Posts: 1,529
Registered: 9/23/99
Re: Sharing TDataModule between VCL and FireMonkey applications
Correct
Click to report abuse...   Click to reply to this thread Reply
  Posted: Sep 26, 2015 12:15 PM   in response to: Davide Rubbiani in response to: Davide Rubbiani
Davide Rubbiani wrote:
Hello,

I'm developing a project using XE8.

Due to availability of third party components I'm working on a FMX (multi platform) application for normal user GUI and a VCL application for administrative users GUI.
Both the applications could share some data modules but when I add the most simple VLC data module I developed (its composed by just two components, one TFDStanStorageBinLink and one TFDMemTable) to FMX application I get the following error :

Unit "MyDatamodule" is incompatible with the FMX framework used by the project.
Adding it may result in compilation errors or unexpected behavior. Continue ?

I read some post on the Internet and it seems that if no strictly VCL related components are used in Data Module the Data Module should be sherable between FMX and VCL applications.

I saw the {%CLASSGROUP 'Vcl.Controls.TControl'} that could be the compatibility problem between FMX and VCL.

Yes it is, you should be able to just remove it altogether.

So how should I proceed ?
I can press "Yes" and be sure that everything will work in the right way ? (so way the error message ?)
Are definitely Data Modules sherable between VCL and FMX applications ?

Yes they are

If yes what are the limits to be shure that a Data Module is sherable ?

Really none. You should not put non visual framework specific stuff on there
(Dialogs, meus etc). Database access layers are not part of either framework.



Thank you,
Davide

--
Jeff Overcash (TeamB)
(Please do not email me directly unless asked. Thank You)
Learning is finding out what you already know. Doing is demonstrating that you
know it. Teaching is reminding others that they know it as well as you. We are
all leaners, doers, teachers. (R Bach)

Legend
Helpful Answer (5 pts)
Correct Answer (10 pts)

Server Response from: ETNAJIVE02