Use Dll as Wrapper


(Tobias Jacobi) #1


we are working with Hydra to use the C# components of GdPicture.
We made a working solution for using the Hydra-GdPicture-Classes directly in our Delphi applications.

Now we like to transfer the use of Hydra into a dll. For that we made some interfaces that we give back to the app as result of the creation in the dll.
This works fine too, until we try to use the Viewer of GdPicture. The Viewer is created and you can use every property and function of the Viewer-class. But it doesn´t become visible.
The ShowParented-Code of the Hydra-Plugin creates an THyPluginPanel which also stays invisible.

Is it possible to use Hydra that way, at all ?
Are there any Demos showing how to do it ?

Best regards

(antonk) #2


Could you please elaborate? Did you already have a working Hydra plugin and host app and after some code reorganization in the host app it doesn’t work anymore?

Was the component in question (the Viewver) worked properly before that reorganization?


(Tobias Jacobi) #3


yes you are right.
We have a working plugin. But this is integrated directly in the application source.
We use the plugin in several applications.
So each time we change the plugin, we have to compile every application.
So we like to generate a dll that encapsulates all functions, and we only have to compile the dll and one application.

What we changed is to use interfaces to interop between app and dll.


(antonk) #4

The solution you described should work without any issues.
Could you create a testcase (a simplified plugin and host apps) and send it to support@ ?

(Tobias Jacobi) #5


I sent a mail with a test project.
The zip has 25 MB due to the GdPicture dlls.


(Tobias Jacobi) #6

it seems I can´t get through.
I sent a second mail without any attachment and received no answer from “Marvin”.

So what can I do ?


(antonk) #7

Please try to resend the mail later or try to send it directly to me at antonk@

(Tobias Jacobi) #8

now I sent to antonk@


(EvgenyK) #9


what version of delphi you are using? at compiling your project , Delphi 10.2.3 said

[dcc32 Fatal Error] ghuGdPictureInterface_Test.pas(9): F2613 Unit ‘hpgdpicture_18_0_3_Import’ not found.

(Tobias Jacobi) #10


we are using Delphi 10.1

So you have to change the unit clause to hpgdpicture_18_0_3_Import_test.


(EvgenyK) #11

try to build your app and bpl with vcl and rtl runtime packages:

if you get error like EConvertError with message 'Cannot assign a TFont to a TFont'. this means that runtime package that contain this class, should be used by host and plugin

(Tobias Jacobi) #12


using runtime packages is no option.

(EvgenyK) #13

Hydra can work w/o runtime packages , in COM-compatible mode, only if native delphi objects aren’t used.
in your case, they are used so it can work only with runtime packages when the same address space is used.

w/o using runtime packages, I have Exception class EConvertError with message 'Cannot assign a TFont to a TFont'. Process Project29.exe (8880)

callstack is:

:04BD3BCB Vcl::Controls::TControl::Perform(Self=????, Msg=????, WParam=????, LParam=0)
:04BD712B Vcl::Controls::TWinControl::InsertControl(Self=????, AControl=????)
:04C182A2 Uhyvclcrossplatformvisualpluginwrapper::THYVCLCrossPlatformVisualPluginWrapper::ShowParented(Self=:03636A38, aParent=:012C46C0)
:04C45700 Ghugdpicturewrapper_dll_test::TGDPictureViewer::Set_Parent(Self=:035D5420, AParent=:012C46C0)

you can try to use FMX based controls. they may work better in your case