Recent

Author Topic: Out-of-process COM server  (Read 1352 times)

Arvur

  • New Member
  • *
  • Posts: 38
    • My GitHub
Out-of-process COM server
« on: February 01, 2019, 02:46:44 pm »
Hello!

I've created a simple application with COM-object in Delphi XE6 (see TestAuto.dpr).
Compiled it, executed with /regserver and successfully tested in Internet Explorer 11 in Win7x64 (see TestAuto.html) - pressing button returns value.

Then I compile it in Lazarus (TestAuto.lpi). It occurs there is no /regserver support in Lazarus but COM-object is registered already by Delphi app.
Ooops... Test page hangs this time. Application is started thow. Tested with Lazarus 1.8.4 and 2.0RC3.

Ok. Some cleanup: recompile the project in Delphi again to execute /unregserver.

Now I create simple library (see TestAutoLib.dpr), compile it with Delphi and execute regsvr32. Test page works fine.
Next step: Same library compiled with Lazarus (TestAutoLib.lpi) works fine too!

The problem is only with out-of-process COM server in Lazarus application.

Can somebody point me how to get it work? Thanks a lot!!

FYI: I've compiled Lazarus app with units from Delphi 7  :-[ (ActiveX, ComConst, ComObj and ComServ - all renamed to avoid confusing). It does not help.
« Last Edit: February 01, 2019, 02:58:54 pm by Arvur »

ASerge

  • Hero Member
  • *****
  • Posts: 1395
Re: Out-of-process COM server
« Reply #1 on: February 01, 2019, 09:10:46 pm »
Can somebody point me how to get it work? Thanks a lot!!
I think this is an implementation error in FPC. It always creates the 'InprocServer32' key (see TComObjectFactory.UpdateRegistry). But must be either 'InprocServer32' for DLL or 'LocalServer32' for EXE.

Arvur

  • New Member
  • *
  • Posts: 38
    • My GitHub
Re: Out-of-process COM server
« Reply #2 on: February 01, 2019, 09:20:12 pm »
I think this is an implementation error in FPC. It always creates the 'InprocServer32' key (see TComObjectFactory.UpdateRegistry). But must be either 'InprocServer32' for DLL or 'LocalServer32' for EXE.
I'm afraid that's not it ((
I've registered server with Delphi-compiled application. So LocalServer32 key must be there already. And Internet Explorer starts Lazarus application successfully. Also Lazarus application compiled with Delphi source for TComObjectFactory hangs page too.

ASerge

  • Hero Member
  • *****
  • Posts: 1395
Re: Out-of-process COM server
« Reply #3 on: February 01, 2019, 09:51:37 pm »
I think this is an implementation error in FPC. It always creates the 'InprocServer32' key (see TComObjectFactory.UpdateRegistry). But must be either 'InprocServer32' for DLL or 'LocalServer32' for EXE.
I'm afraid that's not it ((
I insist. It's just not the last error. After I registered the program compiled by Delphi, and then recompiled it in Lazarus, application (even with the form) in IE displayed, but the input focus in IE is lost (next error). But if I use the registration from FPC application - it does not appear at all.

Arvur

  • New Member
  • *
  • Posts: 38
    • My GitHub
Re: Out-of-process COM server
« Reply #4 on: February 01, 2019, 11:17:14 pm »
I insist. It's just not the last error. After I registered the program compiled by Delphi, and then recompiled it in Lazarus, application (even with the form) in IE displayed, but the input focus in IE is lost (next error). But if I use the registration from FPC application - it does not appear at all.
You are right. There is error in registration. But we know how to fix/bypass this error - Lazarus application is started by IE after all.
The main problem is that while the application is running it still does not work with the calling page in IE. And this problem remains even if we use Delphi units (that makes me confused).
« Last Edit: February 01, 2019, 11:18:49 pm by Arvur »