On Tuesday, 9 January 2018 at 14:43:43 UTC, Benjamin Thaut wrote:
Am 09.01.2018 um 12:02 schrieb MrSmith:
Is it possible to put common code in exe, and use that code from dlls? Or anything can be exported only by dll?

You can only export from dlls. I don't know of any use case where exporting from a executable would make sense. No, you can't put common code into a executable and use that code from dlls. Thats not how dlls are designed to work on windows.

If you absoutely still want to export from an executable you can still use -L/EXPORT:"mangledSymbolName"


Is it possible to have circular dependencies between dlls?

No. You will get linker errors. Same as in C/C++.


Tips for doing dlls with dub?

Well, first my PR will have to get merged. Then you'll have to wait until a release exists that actually has my changes and then maybe there is support added in dub. Before that I think trying to use dub to create dlls is wasted effort.

I am building a bridge between Delphi and D. At the moment the executable is written in D and the Dll (Firemonkey UI) is written in Delphi. But I think I want to enable also the other way around. The D coding which is then located in the Dll should be able to call Delphi methods located in the executable. The whole idea idea is that all logic is written in D and you only use the Framework (ui) and libraries Delphi provides.

I think this might be a valid use case for a Dll calling functionality located in the exe.

Kind regards
Andre

Reply via email to