1

I am using com .dll within my Delphi application. for this I registered my com .dll using regsvr32.exe .dll name command. It registered fine and then i converted this com .dll to type library (.tlb pas file).

So now I am using this .tlb pas file to communicate com object. .tlb file gave me wrapper class for communicate with dll.

This all works fine in my machine because dll registered in my machine. But when i put my application on another machine then it throws error like 'Class not registered'.

How I can registered .dll or perticuler class in another machine. We can not registered .dll as manually as i did on my machine for all machines.

please let me know how I can register .dll or coclass pragmatically.

Ankush
  • 89
  • 1
  • 1
  • 8
  • 1
    That's what installer should do. – Victoria Oct 04 '17 at 06:04
  • Either register the class, or use registration free com – David Heffernan Oct 04 '17 at 08:03
  • Yes , i use inno set up installer to install my delphi application. But I really donot know How can i register .dll using inno set up. If I add this dll file in inno set up it only put on perticuler path ,it wil not register. – Ankush Oct 04 '17 at 08:12
  • Inno installer can be programmed in a Delphi-like language. You can do a lot. – Rudy Velthuis Oct 04 '17 at 10:38
  • Yes thanks I did . Thanks for your help to all – Ankush Oct 04 '17 at 11:19
  • You have to do the exact same thing you did on your own machine: "*I registered my com .dll using regsvr32.exe*", so instruct Inno to do that. – Remy Lebeau Oct 04 '17 at 15:08
  • 1
    Just set the ["regserver"](http://www.jrsoftware.org/ishelp/index.php?topic=isxfunc_registerserver) flag for your file in your script. Inno also has "RegisterServer" and "RegisterTypeLibrary" procedures. If you wonder the answer to your question anyway, you should call "DllRegisterServer" from your library. – Sertac Akyuz Oct 04 '17 at 16:25
  • Thanks I used regserver in inno set up Its works for me – Ankush Oct 09 '17 at 08:31

1 Answers1

0

you can pack com.dll with package installation and in installing progress copy the com.dll file to "C:\Windows\system32" Programmatically

To Register it : ShellExecute(handle, 'open', 'C:\Windows\system\Regsvr32.exe', '/S com.dll', nil, SW_SHOWMINIMIZED);

Asad Alamdar
  • 158
  • 8