[fpc-pascal] support forusinganactivex

Roberto Padovani padovani.r at gmail.com
Wed Jun 1 17:17:48 CEST 2011


Finally, I've been able to use the activex collection without any
EOleSysException.
I was able to use the collections from Word and Excel, but not from
the dll I had.

FPC 2.5.1   from svn   r17599  fixed it.

Thanks everyone,

  Roberto


2011/5/31 Ludo Brands <ludo.brands at free.fr>:
> You can send me the file directly. Address is in the message.
>
> To install fpc from svn: http://wiki.lazarus.freepascal.org/Getting_Lazarus
> has good instructions.
>
> Ludo
>
>
>> -----Message d'origine-----
>> De : fpc-pascal-bounces at lists.freepascal.org
>> [mailto:fpc-pascal-bounces at lists.freepascal.org] De la part
>> de Roberto Padovani
>> Envoyé : mardi 31 mai 2011 17:41
>> À : FPC-Pascal users discussions
>> Objet : Re: RE : RE : RE : RE : RE : RE : RE : RE :
>> [fpc-pascal] support forusinganactivex
>>
>>
>> I triede with fpc 2.4.4 but nothing changes. Would you mind
>> having a look a the full dll with your more recent fpc? By
>> the way, how do I install fpc 2.5.x ?? I might send it to you
>> privately; the only trouble is that you don't have a real
>> hardware to connect it, even if the transducers class are
>> created during the main device creation and their count and status are
>> (should) always be available even if not connected.
>>
>> A test case would simply:
>> 1) createoleobject  //OK
>> 2) object.transducers.count // OK, always 8
>> 3) object.transducers(1).Status   //   ???? should be an integer, not
>> a crash !!!
>>
>> R#
>>
>>
>> 2011/5/31 Roberto Padovani <padovani.r at gmail.com>:
>> > Thanks, I'll try installing a more recent fpc and lazarus...
>> >
>> >
>> >
>> > 2011/5/30 Ludo Brands <ludo.brands at free.fr>:
>> >> I created a small automation object with following IDL
>> (part of it):
>> >>
>> >>   interface ItestAX: IDispatch
>> >>  {
>> >>    [
>> >>    propget,
>> >>    id(0x00000001)
>> >>    ]
>> >>    HRESULT _stdcall Devices([out, retval] IDevices ** Value );
>> >>  };
>> >>
>> >>   interface IIDevices: IDispatch
>> >>  {
>> >>    [
>> >>    propget,
>> >>    id(0x00000000)
>> >>    ]
>> >>    HRESULT _stdcall Device([in] long Idx, [out, retval] IDevice **
>> >> Value );
>> >>    [
>> >>    propget,
>> >>    id(0x00000002)
>> >>    ]
>> >>    HRESULT _stdcall Count([out, retval] long * Value );
>> >>  };
>> >>
>> >>   interface IIDevice: IDispatch
>> >>  {
>> >>    [
>> >>    propget,
>> >>    id(0x00000001)
>> >>    ]
>> >>    HRESULT _stdcall Name([out, retval] BSTR * Value );
>> >>  };
>> >>
>> >> This matches pretty much the interface you described earlier. Note
>> >> the
>> >> id(0x00000000) which makes Device the default member of
>> IIDevices. This is
>> >> the same as id(DISPID_VALUE) in your case.
>> >>
>> >> Now, the following lines do work for me to get the Name member of
>> >> IIDevice
>> >> (ActX,a,b:variant;s:string):
>> >>
>> >>  ActX:=CreateOleObject(MyTestControl);
>> >>  a:=ActX.Devices;
>> >>  b:=a.Device[3];
>> >>  s:=b.Name;
>> >>  b:=ActX.Devices.Device[3];
>> >>  s:=b.Name;
>> >>  b:=ActX.Devices[3];
>> >>  s:=b.Name;
>> >>
>> >> Note that the default member does work correctly:
>> >> Devices.Device[3]===Devices[3].
>> >>
>> >> I'm using fpc 2.5.1 svn 17599.
>> >>
>> >> Ludo
>> >>
>> >> _______________________________________________
>> >> fpc-pascal maillist  -  fpc-pascal at lists.freepascal.org
>> >> http://lists.freepascal.org/mailman/listinfo/fpc-pascal
>> >>
>> >
>> _______________________________________________
>> fpc-pascal maillist  -  fpc-pascal at lists.freepascal.org
>> http://lists.freepascal.org/mailman/listinfo/fpc-pascal
>>
>
> _______________________________________________
> fpc-pascal maillist  -  fpc-pascal at lists.freepascal.org
> http://lists.freepascal.org/mailman/listinfo/fpc-pascal
>



More information about the fpc-pascal mailing list