Call .NET 4.0 built dll in Delphi 7

After searching and applying all the solutions for the problem below do not work. What I did- 1. I created .dll in C #, made it visible. 2. I created a .tlb file using regasm. 3. Created a Delphi 7 project, where I imported a library of this type (.tlb) and calling the function of this DLL. 4. Everything works fine on my PC.

Now that I have copied all these files (including .dll, even .dcu) to another computer (.NET Framework 4.5 installed) and tried to run .exe, it gives me the error " Class not registered " when I tried to register it using RegSvr32, then it shows an error - " Entry point not found ."

What else am I missing? Is there another prerequisite for running Delphi 7 exe with dll on another PC?

+4
source share
1 answer

To register a .net assembly, you should use regasm, not regsvr32.

Making the entire assembly COM node visible is probably a mistake. Do you really want the entire open COM type to be visible? It would be more common to apply an attribute ComVisibleto certain types.

You do not need to copy dcu files. They are used as intermediate files for the Delphi compiler. Assuming you are not using runtime packages, the entire executable and registered assembly are enough.

+9

Source: https://habr.com/ru/post/1618997/


All Articles