1

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.

John
  • 261
  • 2
  • 16
  • Iirc, you can use the code in the source of TRegSvr.Exe (`TRegSvr.Dpr`) to register the .Dll from your own app. – MartynA Jul 17 '18 at 15:51
  • 2
    Don't do it like this. Ship the executable and the DLL, and use registration free COM. – David Heffernan Jul 17 '18 at 16:19
  • @DavidHeffernan The environment i'm working with on my user end is very restricted. – John Jul 18 '18 at 07:13
  • 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 Jul 18 '18 at 07:31
  • @DavidHeffernan I found this https://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 Jul 18 '18 at 07:35
  • @John I don't know. I've not done this myself. – David Heffernan Jul 18 '18 at 08:11

1 Answers1

1

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.

  • How does the generated tlb call the dll methods?... The registry gives the path to the dll and that's what's going on in the backend without it, only with the tlb you can't do much. And i have no idea how to use that code you send me through this link. – John Jul 18 '18 at 07:20