Board index » delphi » Converting from VB - Problems with an ActiveX control

Converting from VB - Problems with an ActiveX control

Hello,

I am converting some VB to Delphi that uses some Novell ActiveX controls.  

One of these controls is used to load a VB ImageList with images.  The VB

code used is:

For Each bitmap in NWDir1.Pictures
        Call ImageList1.ListImages.Add(, bitmap.ImageIndex,
bitmap.Picture)
Next bitmap

However, on trying to convert this to Delphi, I am having problems
getting something like this to work with a TImageList.  The main problem
seems to be that the Novell ActiveX bitmap.Picture property is a
IPictureDisp, as defined in ActiveX.pas.  However, my understanding is
that one can only add TBitmaps to to the image list.

Does anyone have any idea how to do this?  Any hints are much
appreciated.

Thanks,

Grant

 

Re:Converting from VB - Problems with an ActiveX control


You should be able to convert a PictureDisp into a TPicture using the
AxCtrls.SetOlePicture function.

--
have fun
Binh Ly
http://www.techvanguards.com

Quote
"Grant" <gr...@here.com> wrote in message

news:MPG.159bf7d246396fa3989681@newsgroups.borland.com...
Quote
> However, on trying to convert this to Delphi, I am having problems
> getting something like this to work with a TImageList.  The main problem
> seems to be that the Novell ActiveX bitmap.Picture property is a
> IPictureDisp, as defined in ActiveX.pas.  However, my understanding is
> that one can only add TBitmaps to to the image list.

> Does anyone have any idea how to do this?  Any hints are much
> appreciated.

Re:Converting from VB - Problems with an ActiveX control


Do you use TypeCast?

Something like ImageList1.ListImages.Add(bitmap.ImageIndex,
 bitmap.Picture as TBitmap)

Other Threads