dot net dll in free pascal?

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

dot net dll in free pascal?

Luca Olivetti-2
A sizeable part of my day job is to program PLCs in the worst software
environment ever (for the curious, simatic tia portal, actually I'm
mostly using the older, only marginally better, step 7, but the times
they are a-changin').
Said piece of sh^H^Hfine engineering, provides a dll to automate some
tasks, however, being a steaming pile of...fine engineering, it's made
with dot net and the instructions on how to use it only mention visual
something (page 12 of this document
https://support.industry.siemens.com/cs/attachments/108716692/108716692_TIA_Openness_GettingStartedAndDemo_V14SP1_en.pdf).

Is it possible to someway use it with fpc?
I tried the "import type library.." menu item that lazarus provides with
no success ("error loading the dll", strangely enough localized even if
my lazarus is in english, so I suppose that comes from windows).

The file command under Linux says:
Siemens.Engineering.dll: PE32 executable (DLL) (console) Intel 80386
Mono/.Net assembly, for MS Windows


TIA (pun intended)
--
Luca



_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: dot net dll in free pascal?

Free Pascal - General mailing list
Luca Olivetti <[hidden email]> schrieb am Mo., 13. Mai 2019, 23:14:
A sizeable part of my day job is to program PLCs in the worst software
environment ever (for the curious, simatic tia portal, actually I'm
mostly using the older, only marginally better, step 7, but the times
they are a-changin').
Said piece of sh^H^Hfine engineering, provides a dll to automate some
tasks, however, being a steaming pile of...fine engineering, it's made
with dot net and the instructions on how to use it only mention visual
something (page 12 of this document
https://support.industry.siemens.com/cs/attachments/108716692/108716692_TIA_Openness_GettingStartedAndDemo_V14SP1_en.pdf).

Is it possible to someway use it with fpc?
I tried the "import type library.." menu item that lazarus provides with
no success ("error loading the dll", strangely enough localized even if
my lazarus is in english, so I suppose that comes from windows).

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. 

Regards, 
Sven 

_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: dot net dll in free pascal?

Luca Olivetti-2
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".


Bye
--
Luca
_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: dot net dll in free pascal?

Free Pascal - General mailing list
Luca Olivetti <[hidden email]> 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:


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. 

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

Regards,
Sven 

_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: dot net dll in free pascal?

Luca Olivetti-2
El 14/5/19 a les 14:12, Sven Barth via fpc-pascal ha escrit:

>
> 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.

Thank you, I'll see if I can do something with any of those links.


Bye
--
Luca
_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal