1
votes

I've made a dll in c# an made it com visible then used it in delphi. In order to do that i had to register the dll so that i could install that as a component in my delphi ide. (I registered the dll with the interop thing then in delphi went to install component > type library > selected my com dll and it created everything for use of it.)

The problem i'm facing now is that i want to use the exe on another machine without having to register the dll. Is it possible to compile the exe file with the registered com dlls?

I have a solution to this is to not use the com obj but just go with unmanaged dll and export all the methods i want but i would prefer embedding the dll/com into my exe and i can't seem to find a solution to this, i don't know if it's possible.

1
Iirc, you can use the code in the source of TRegSvr.Exe (TRegSvr.Dpr) to register the .Dll from your own app.MartynA
Don't do it like this. Ship the executable and the DLL, and use registration free COM.David Heffernan
@DavidHeffernan The environment i'm working with on my user end is very restricted.John
If you are using COM, you need to tell the executable how to find the COM server. Which means either registering the COM server, or using registration free COM. If you don't want to register the COM server, use registration free COM. There isn't going to be a magic bullet solution. You are going to need to learn a whole bunch of new stuff. It will take time. Don't expect to solve this in hours.David Heffernan
@DavidHeffernan I found this stackoverflow.com/questions/5074563/registration-free-com-dll Just if you know it, any idea what's the .X file he uses in the answer instead of a .dll?John

1 Answers

1
votes

Use dynamic loading of CLR technique to load and use DLL. refer to this Hosting the .NET runtime in a Delphi Program you might get your answer.

In dynamic loading technique you need not register the DLL you just have to generate a TLB and interface for your DLL and through that use the DLL.