i do not want create a tlb, update the references, etc, so i am load .net dll in runtime, i can call and use class and methods non static like that:
procedure TForm1.Button1Click(Sender: TObject);
var
Host: TJclClrHost;
Obj: OleVariant;
result: string
begin
Host := TJclClrHost.Create('v4.0.30319');
Host.Start();
Obj := Host.DefaultAppDomain
.CreateInstance('DLLNAME',
'NAMESPACE.INSIDE.CLASS.THAT.I.WANT')
.UnWrap();
result:= Obj4.<MethodName>(Parameters...);
....
end;
and that work wonders for non static methods....static methods i cant figure how do that using JEDI/jcl
how i call a static class/method from delphi using jed/jcl or if there is another way to do that in runtime fell free to tell me, I just do not want have to make references, generate tlbs etc, just put the dll in the folder and use.
exemple of static class in the dll .net:
using System;
using System.Text;
using System.Security.Cryptography;
using System.IO;
using System.Linq;
using System.Runtime.InteropServices;
namespace DLLSTATIC.SOMESUBNAME
{
[ComVisible(true)]
[ClassInterface(ClassInterfaceType.AutoDual)]
[ProgId("DLLSTATIC.SOMESUBNAME.staticclass")]
public static class staticclass
{
[ComVisible(true)]
public static string test123(string param)
{
return "test1234";
}
}
}
ps. i am declaring com visible but i will not use this dll as COM
I don't like the com and tlb.
You can also call .net dll at runtime by using DDNRuntime(Delphi .NET Framework/.NET Core Runtime)
https://github.com/ying32/DDNRuntime-examples
It can help you call .net fuctions easily
Just like