Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / lazarus / 2012-01

RE : ActiveX control demo

10 messages · 4 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Ludo Brands
Show quoted text 33 lines
-----Message d'origine----- De : Volker Sch?fer [mailto:] Envoy? : dimanche 22 janvier 2012 18:13 ? : ; Objet : Re: [Lazarus] ActiveX control demo Dear Lazarus Developers, at first, sorry about my bad english. I tried to use Mr. Brands importtlv0.4.zip from here: http://bugs.freepascal.org/view.php?id=20958. I compiled it with FPC 2.6.0 and converted DesignCad 17 Typelibrary. The typlibimporter works well, but in the first part of the Unit are a lot of warnings that PSafeArray not automatable in IDcadSolidEntitydisp.AddItems and so on. But I need PSafeArray for my Project. I had a look in VarUtils.pas and ActiveX.pas and I think there are differences between VarUtils on Lazarus and VarUtils on Delphi. And perhaps on ActiveX too. Is there a trick to use it? Could you help me? Many thanks and best regards Volker Sch?fer

First of all, a newer version of importtl and typelib is commited in fpc trunk. Some other bug-fixes where submitted in
http://bugs.freepascal.org/view.php?id=21077.

The PSafeArray warning is only for dispinterface. Most typelibs have both interface and dispinterface definitions for the same interface. Dispinterface is using late binding and can use only automatable types. Using the interface definitions, you have all the advantages of early binding and you can use PSafeArray directly.

The warning doesn't mean it isn't working. It only means that you have a "generic" olevariant without any "sub-type" information. The warning is there to give you what is exactly expected in the olevariant. You can simply assign a VarArray created with VarArrayCreate to the olevariant.

In freepascal, to use PSafeArray you use the function VarArrayAsPSafeArray. Despite the name, this returns a PVarArray which you can cast to PSafeArray (structures are the same).

Ludo

Reply by email

Sven Barth
to Ludo Brands

Just because I noticed this mail:
I tried today to convert the Windows Image Acquisiton Automation Library (Windows\system32\wiaaut.dll) on a Windows 7 32-Bit system (using FPC 2.7.1 from yesterday evening). The resulting unit was not compileable as it contains at least two errors. I have attached the unit for you to check.

Regards,
Sven
-------------- next part --------------
A non-text attachment was scrubbed...
Name: WIA_1_0_TLB.zip
Type: application/x-zip-compressed
Size: 9838 bytes
Desc: not available
URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20120123/f6006a5a/attachment-0001.bin>

Reply by email

Felipe Monteiro de Carvalho
to Sven Barth: Just because I noticed this mail: I tried today to convert the Windows Image Acquisiton…

2012/1/23 Sven Barth :

I tried today to convert the Windows Image Acquisiton Automation Library (Windows\system32\wiaaut.dll) on a Windows 7 32-Bit system (using FPC 2.7.1 from yesterday evening). The resulting unit was not compileable as it contains at least two errors. I have attached the unit for you to check.

Is there a tutorial somewhere saying what to do to import a COM Automation object with this new tool? And in general what to do with the result later...

thanks,

Felipe Monteiro de Carvalho

Reply by email

Ludo Brands
to Sven Barth: Just because I noticed this mail: I tried today to convert the Windows Image Acquisiton…
Show quoted text 20 lines
-----Message d'origine----- De : Sven Barth [mailto:] Envoy? : lundi 23 janvier 2012 13:02 ? : Lazarus mailing list Cc : Ludo Brands Objet : Re: [Lazarus] RE : ActiveX control demo Just because I noticed this mail: I tried today to convert the Windows Image Acquisiton Automation Library (Windows\system32\wiaaut.dll) on a Windows 7 32-Bit system (using FPC 2.7.1 from yesterday evening). The resulting unit was not compileable as it contains at least two errors. I have attached the unit for you to check. Regards, Sven

These 2 problems have the same cause and are fixed in the patch in http://bugs.freepascal.org/view.php?id=21077 :

-disambiguate method name for INVOKE_PROPERTYPUT and INVOKE_PROPERTYPUTREF on same property (ado\msado25.tlb)

Using the latest fixes results in no errors for this typelib (I don't have win7 32bit but used the dll in the wiaautsdk).

Ludo

Reply by email

Ludo Brands
to Felipe Monteiro de Carvalho: 2012/1/23 Sven Barth : Is there a tutorial somewhere saying what to do to import a COM…
Is there a tutorial somewhere saying what to do to import a COM Automation object with this new tool?

Not yet. Importtl creates a pascal unit that declares all interface exported by a COM typelib (dll, exe, tlb or olb). The resulting unit is like a library binding but consists of interface declarations instead of function declarations.

I've also finished a lazarus package that integrates the tool into lazarus. It includes an ActiveXContainer (TWinControl descendant) that allows for visual activex components. The package also creates new ActiveX component packages directly from the typelib. The latest patch in http://bugs.freepascal.org/view.php?id=21077 contains the last bits needed in importtl and typelib to support this. Once that is commited I'll submit the lazarus package to the lazarus issue tracker. Documentation will follow.

And in general what to do with the result later...

That is the same as asking "what can you do with a library". The answer is: "depends on the object". Most of the COM objects have documentation to describe what the interfaces do.

Ludo

Reply by email

Felipe Monteiro de Carvalho
to Ludo Brands: Not yet. Importtl creates a pascal unit that declares all interface exported by a COM…
Ludo Brands wrote 7 lines
> Is there a tutorial somewhere saying what to do to import a > COM Automation object with this new tool? Not yet. Importtl creates a pascal unit that declares all interface exported by a COM typelib (dll, exe, tlb or olb). The resulting unit is like a library binding but consists of interface declarations instead of function declarations.

I started documenting COM (although I don't know much on the subject, so contributions are really welcome):

http://wiki.lazarus.freepascal.org/Windows_Programming_Tips#COM_Programming

And I compiled and "released" importtl. So that people using older FPC versions can download it and use it.

Felipe Monteiro de Carvalho

Reply by email

Ludo Brands
to Felipe Monteiro de Carvalho
Show quoted text 13 lines
>> Is there a tutorial somewhere saying what to do to import a COM >> Automation object with this new tool? > > Not yet. Importtl creates a pascal unit that declares all interface > exported by a COM typelib (dll, exe, tlb or olb). The resulting unit > is like a library binding but consists of interface declarations > instead of function declarations. I started documenting COM (although I don't know much on the subject, so contributions are really welcome):

http://wiki.lazarus.freepascal.org/Windows_Programming_Tips#COM_Programming

And I compiled and "released" importtl. So that people using older FPC

versions can download it and use it.

Quite busy now but as soon I have more time, I'll update the docs.

Ludo

Reply by email