[fpc-pascal] dot net dll in free pascal?

Sven Barth pascaldragon at googlemail.com
Tue May 14 14:12:55 CEST 2019


Luca Olivetti <luca at ventoso.org> schrieb am Di., 14. Mai 2019, 09:13:

> El 14/5/19 a les 0:15, Sven Barth via fpc-pascal ha escrit:
>
> >     The file command under Linux says:
> >     Siemens.Engineering.dll: PE32 executable (DLL) (console) Intel 80386
> >     Mono/.Net assembly, for MS Windows
> >
> >
> > You could try to host the .Net CLR. I've never done it, but there exists
> > code for that for Delphi:
> > https://sourceforge.net/projects/dotnetruntimelibraryfordelphi/
> > So that should be possible in FPC as well.
>
>
> Thank you but:
>
> "Delphi or RAD Studio has not been installed on this computer. The .Net
> Runtime Library for Delphi Trial Edition 6.0.6.0 requires an installed
> and licensed Delphi or RAD Studio 2010, XE, XE2 and higher versions".
>

Hmm... I did not see that this is a commercial solution. What is something
like that doing on SourceForge?! -.-

Well as an alternative you can try the .Net hosting code from the JCL,
though I don't know what changes you'd need to do to get the necessary
units working with FPC:

https://github.com/project-jedi/jcl/blob/master/jcl/source/windows/JclDotNet.pas
https://adamjohnston.me/delphi-dotnet-interop-with-jvcl/

Also it seems that this code requires the assembly to have a COM visible
API, so you'd need to test this.

Alternatively here is an example by Microsoft to host the CLR yourself.

https://code.msdn.microsoft.com/CppHostCLR-e6581ee0

In both cases you'll have to create type library imports for mscoree and
mscorlib.

Regards,
Sven
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freepascal.org/pipermail/fpc-pascal/attachments/20190514/f0409485/attachment.html>


More information about the fpc-pascal mailing list