Recent

Author Topic: Can we create com objects with Lazarus?  (Read 986 times)

superekon

  • Guest
Can we create com objects with Lazarus?
« on: June 05, 2020, 01:59:51 pm »
Hi
with current release of Lazarus, we can manage com object like Excel or Word on Windows XP , but can we create com object ?
do we have a tool to create a TLB file ?

Thanks for your help
« Last Edit: June 06, 2020, 03:47:44 pm by Martin_fr »

PascalDragon

  • Hero Member
  • *****
  • Posts: 1694
  • Compiler Developer
Re: Can we create com objects with Lazarus?
« Reply #1 on: June 05, 2020, 02:35:20 pm »
Yes, it is possible. You can essentially use any tutorial that's available for Delphi. In essence you need a library project that exports the functions DllGetClassObject, DllCanUnloadNow, DllRegisterServer and DllUnregisterServer from the unit ComServ and you need to register your COM object with TComObjectFactory.Create in your unit's initialization section. I've done this for a Windows Search Engine filter already.

Please note that a type library is only needed if you want to provide a completely new COM interface. If you want to simply implement an existing COM interface (and provide it e.g. to the Windows Explorer) none is needed.

ASerge

  • Hero Member
  • *****
  • Posts: 1613
Re: Can we create com objects with Lazarus?
« Reply #2 on: June 05, 2020, 03:28:54 pm »
do we have a tool to create a TLB file ?
Unfortunately, Lazarus doesn't have the tools to create tlb files.

eljo

  • Sr. Member
  • ****
  • Posts: 407
Re: Can we create com objects with Lazarus?
« Reply #3 on: June 06, 2020, 02:46:35 am »
Hi
with current release of Lazarus, we can manage com object like Excel or Word on Windows XP , but can we create com object ?
do we have a tool to create a TLB file ?

Thanks for your help
There is a tlb editor in the web service toolkit, but I have no idea how useful it is  for COM https://wiki.lazarus.freepascal.org/Web_Service_Toolkit

PS.
  Removed the bait link. Thanks to Handoko's attention to detail.
« Last Edit: June 06, 2020, 02:32:45 pm by eljo »

wytwyt02

  • Jr. Member
  • **
  • Posts: 83
Re: Can we create com objects with Lazarus?
« Reply #4 on: June 06, 2020, 03:14:24 am »
Why still use Xp?

PascalDragon

  • Hero Member
  • *****
  • Posts: 1694
  • Compiler Developer
Re: Can we create com objects with Lazarus?
« Reply #5 on: June 06, 2020, 10:55:09 am »
do we have a tool to create a TLB file ?
Unfortunately, Lazarus doesn't have the tools to create tlb files.

As said in most cases that shouldn't be required anyway. Only if you want to create a completly new COM interface (or ActiveX object) you'll need to provide a type library as well.

Why still use Xp?

I think that was merely an example to illustrate the difference between consuming a COM interface and providing one.

That said my company still provides our software as compatible with Windows XP, because there still are customers willing to pay for us supporting it (and as long as it doesn't take unnecessary hurdles to support we prefer to indeed do so).

Handoko

  • Hero Member
  • *****
  • Posts: 3542
  • My goal: build my own game engine using Lazarus
Re: Can we create com objects with Lazarus?
« Reply #6 on: June 06, 2020, 02:27:17 pm »
Warning !!!

The first post (by OP) is a spam post. See the image below.
The original non-spam post is here:
https://forum.lazarus.freepascal.org/index.php?topic=8881.0

I usually will simply report to the moderator, but it seems many users have been tricked so I posted here.
« Last Edit: June 06, 2020, 02:36:33 pm by Handoko »

RAW

  • Hero Member
  • *****
  • Posts: 855
Re: Can we create com objects with Lazarus?
« Reply #7 on: June 06, 2020, 02:37:48 pm »
 :)
Windows 7 Pro (x64 Sp1) And Windows XP Pro (x86 Sp3) - LAZARUS 2.0.8 FPC 3.0.4 - TRUNK 2.1.0 FPC 3.3.1
// This is polarity (hell) and hell is reigned by lies, nothing but lies. Be careful what you believe ...
// There are 10 types of people in this world, those who understand mind control and ...

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 6368
    • wiki
Re: Can we create com objects with Lazarus?
« Reply #8 on: June 06, 2020, 03:49:25 pm »
Original poster banned, and post edited to remove spam. Keeping content for the answers.

 

TinyPortal © 2005-2018