OCX controls without loadcontrols method

Julio Fernandez

New Member
Hello,

Here it is a pure 4gl Progress sample of how to add images to ImageList control. Before all you need to download an OCX Control from Innov8 Computer Software (www.innov8cs.com) that is shareware (thanks).

As you can reed in Kbase ID 17265 ACTIVEX - How To Load an Image into the ImageList Control, what you need to do is build and/or look for an ActiveX control which acts as an intermediary between the ImageList ActiveX Control and the actual image which you want to add to it and to substitute LoadPicture command from V9.

So, after register this new OCX control next code runs perfectly:

DEFINE VARIABLE chLoadPicture AS COM-HANDLE NO-UNDO.
DEFINE VARIABLE chPictureLoaded AS COM-HANDLE NO-UNDO.
DEFINE VARIABLE chImageList AS COM-HANDLE NO-UNDO.

CREATE "Innov8.PictureLoader" chLoadPicture.
CREATE "ComCtl.ImageListCtrl.1" chImageList.

chImageList:ImageHeight = 16.
chImageList:ImageWidth = 16.
chPictureLoaded = chLoadPicture:LoadFile("carpeta.bmp").
chImageList:ListImages:Add(1,,chPictureLoaded).
chPictureLoaded = chLoadPicture:LoadFile("carpet-i.bmp").
chImageList:ListImages:Add(2,,chPictureLoaded).

Problems appear when you try to perform similar commands, but involving control-frames. Anybody knows how to connect an OCX Control com-handle with a control-frame without using a loadcontrols method?

Thanks,

Julio Fernández
santafe@santafesoft.com
www.santafesoft.com
 
Top