'Working with .NET classes in Delphi by using mscorlib
I would like to use .NET classes in Delphi. I included mscorlib unit (which is a TLB) and want to create an instance of e.g. Assembly class. So I have:
uses mscorlib;
var myAssembly: _Assembly;
begin
myAssembly:=CoAssembly.Create;
...
end.
The application is compiled successfully, but when starting it I get an error message saying that the class is not registered.
Any idea how this can be solved?
Solution 1:[1]
By using mscorlib for delphi to call c#.
You can take a look at JEDI or DDNRuntime.
TJclClrHost in JEDI.
DDNRuntime is wrapper for delphi to call c#.
Features
- No need for COM support.
- It is very simple to use, just declare the type and method of .NET in Delphi.
- Dedicated translation tool, input one or more .NET assembly DLL, output one or two Delphi import units.
- Support interface types.
- Support dynamic array (one-dimensional array).
- Support Delegate type.
- Support Event.
- Generic type (Limited support. Only XE8 and above are supported and nested generics are not supported yet, such as:
DNICollection<DNKeyValuePair<TKey, TValue>>such multi-level nesting).
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | KngStr |
