OLE Control - PB equivalent to VB's 'SET' and 'LOADPICTURE'

I'm attempting to load a .bmp image into an OLE object using
PowerBuilder 11.1.  The OLE ActiveX is AddFlow5 and I am using it to
graphically represent links between entities - people, organisations,
addresses, vehicles, telephones, etc.

Documentation for AddFlow5 gives an example in VB script to load the
relevant 'picture' into a node, ie,

SET node.picture = LOADPICTURE("C:\images\person.bmp").

I cannot find a suitable equivalent in PB 11 to either 'SET' or to
'LOADPICTURE'

The developer of AddFlow suggested I try:

OLEObject uo
uo = Create OLEObject
li_Ret = uo.ConnectToObject("c:\picture.gif")
node1.Picture(uo)

The return value shows the picture loaded to the OLE object, uo,
(wouldn't work for a bitmap)
but I get a runtime error on reaching node1.Picture(uo) of
"Error calling external object function picture at line ..."

I've also tried loading a .bmp picture into a BLOB but, again, the
routine fails on "node1.Picture(lblb_picture)", this time with the
runtime error of "Invalid parameter type calling external object
function
picture at line ...".

Assigning either the blob or ole value with an equal sign, in keeping
with the document loadpicture example, gives the error "Type mismatch
accessing external object property picture at line ..."

I've used PB's object browser to look for functions etc in the OLE but
could not find anything
that appeared suitable.

(PB does have a 'loadpicture' function but that is for a PB InkPicture
control and does not work with AddFlow)
0
CallRunner
4/12/2008 2:01:35 AM
sybase.powerbuilder.general 62418 articles. 19 followers. Follow

1 Replies
1539 Views

Similar Articles

[PageSpeed] 20
Get it on Google Play
Get it on Apple App Store

PowerBuilder doesn't have an equivalent function.  What I've been able
to do is use an ImageList control to load the image and then use that
to supply the image to an ActiveX control.

On Fri, 11 Apr 2008 19:01:35 -0700 (PDT), CallRunner
<bill.beale@optusnet.com.au> wrote:

>I'm attempting to load a .bmp image into an OLE object using
>PowerBuilder 11.1.  The OLE ActiveX is AddFlow5 and I am using it to
>graphically represent links between entities - people, organisations,
>addresses, vehicles, telephones, etc.
>
>Documentation for AddFlow5 gives an example in VB script to load the
>relevant 'picture' into a node, ie,
>
>SET node.picture = LOADPICTURE("C:\images\person.bmp").
>
>I cannot find a suitable equivalent in PB 11 to either 'SET' or to
>'LOADPICTURE'
>
>The developer of AddFlow suggested I try:
>
>OLEObject uo
>uo = Create OLEObject
>li_Ret = uo.ConnectToObject("c:\picture.gif")
>node1.Picture(uo)
>
>The return value shows the picture loaded to the OLE object, uo,
>(wouldn't work for a bitmap)
>but I get a runtime error on reaching node1.Picture(uo) of
>"Error calling external object function picture at line ..."
>
>I've also tried loading a .bmp picture into a BLOB but, again, the
>routine fails on "node1.Picture(lblb_picture)", this time with the
>runtime error of "Invalid parameter type calling external object
>function
>picture at line ...".
>
>Assigning either the blob or ole value with an equal sign, in keeping
>with the document loadpicture example, gives the error "Type mismatch
>accessing external object property picture at line ..."
>
>I've used PB's object browser to look for functions etc in the OLE but
>could not find anything
>that appeared suitable.
>
>(PB does have a 'loadpicture' function but that is for a PB InkPicture
>control and does not work with AddFlow)

0
Bruce
4/12/2008 4:08:47 AM
Reply:

Web resources about - OLE Control - PB equivalent to VB's 'SET' and 'LOADPICTURE' - sybase.powerbuilder.general

Resources last updated: 1/14/2016 7:35:04 PM