Lazarus
Programming => General => Topic started by: pedropadel on February 15, 2013, 11:07:13 pm
-
Hello
I'm trying to translate the following application Delphi to Lazarus but I get errors with the following libraries: OleCtrls, OleServer, StdCtrls, OleServer, StdVCL
The application is for connecting with R-Project (statistical software). It is this one:
http://www.menne-biomed.de/download/RDcomDelphi.zip (http://www.menne-biomed.de/download/RDcomDelphi.zip)
What could be the solution? Is there any example in connection R-Project from Lazarus.
I would be very grateful if you could help me.
Thank you very much!
-
This is a very interesting project. Do you have any additional documentation at hand? The web site http://www.menne-biomed.de doesn't seem to be too informative with regard to this issue.
-
No, I have only this code Delphi
Also I have another example, but using a DLL in VB.NET.
Interop.STATCONNECTORCLNTLib.dll
Interop.StatConnectorCommonLib.dll
Interop.STATCONNECTORSRVLib.dll
Imports STATCONNECTORCLNTLib
Imports StatConnectorCommonLib
Imports STATCONNECTORSRVLib
Dim sc1 As StatConnector = New STATCONNECTORSRVLib.StatConnectorClass()
sc1 = New STATCONNECTORSRVLib.StatConnectorClass()
sc1.Init("R")
sc1.Evaluate("1+1")
How are DLLs with Lazarus? Perhaps that could be a solution ...
-
The code provided by Dieter Menne is interesting, but not versatile. It uses COM interfaces and DLLs making the software restricted to Windows.
A cross-platform solution would be preferable, e.g. by using embedded shell calls.
-
How are DLLs with Lazarus? Perhaps that could be a solution ...
How what? Create or link? Well, in any case, consult the documentation: http://www.freepascal.org/docs-html/prog/progch12.html
-
How are DLLs with Lazarus? Perhaps that could be a solution ...
How what? Create or link? Well, in any case, consult the documentation: http://www.freepascal.org/docs-html/prog/progch12.html
Link. How to link a DLL?
-
Link. How to link a DLL?
You have must declare the function(s) you'd like to call from the dll using external declaration AND call it in your program. The DLL will then be automatically linked.
-
The code provided by Dieter Menne is interesting, but not versatile. It uses COM interfaces and DLLs making the software restricted to Windows.
A cross-platform solution would be preferable, e.g. by using embedded shell calls.
I do not care that is only for windows. How would that another solution, using embedded shell calls?
Thanks very much!
-
Link. How to link a DLL?
You have must declare the function(s) you'd like to call from the dll using external declaration AND call it in your program. The DLL will then be automatically linked.
Please would you have a sample code? Thank you very much!
-
Please would you have a sample code? Thank you very much!
Read my link
-
The code provided by Dieter Menne is interesting, but not versatile. It uses COM interfaces and DLLs making the software restricted to Windows.
A cross-platform solution would be preferable, e.g. by using embedded shell calls.
I do not care that is only for windows. How would that another solution, using embedded shell calls?
Thanks very much!
This if performed with fpsystem (http://wiki.freepascal.org/Executing_External_Programs#Unix_fpsystem.2C_fpexecve_and_shell) on Unix-based systems. See http://wiki.freepascal.org/Lazarus_on_Raspberry_Pi#Hardware_access_via_encapsulated_shell_calls for an example. The same technique is possible for invoking commands and statements in R (and, of course, other S implementations)