cancel
Showing results for 
Search instead for 
Did you mean: 

How to access the properties of an OLE object in a datawindow object in powerscript?

Former Member
0 Kudos

By any chance do you know how to access the properties of an ole object in a datawindow in PB Clasic 12.1. First time I am playing with OLE object in a datawindow.

This is the scenario:

I have a data window dw_1 and in dw_1 I inserted an ole object ole_1 (ole_1  is an Angular Gauge to represent % of Labor Efficiency). 

Then I have window with a datawindow control and I use dw_1 as my dataobject. The gauges show up perfectly and seems to be working because if I click on it the needle, it moves to where I click in the ole (at run time).

Also the datawindow work fine (retrieve the data).

The ole_1 object property I need to access is NeedleValue and you set the value with a method SetNeedleValue(Double x). How do I access this method ?

If I tray to set the value of NeedleValue it does not assign the value (at run time), but I think I am not accessing the property correctly. In the datawindow painter the properties are change without any problem

Help on How to access the properties of the ole_1 inside of a datawindow?

If I double click the object in the datawindow painter the properties window of the ole shows and I can change the properties. Now at run time I do not know how to access the properties.

Also this is the code I used to try to set the value to the mentioned property.

dw_1.object.datawindow.ole.ole_1.SetNeedleValue(ldd_est_vrs_actual_range)

As this line of code execute nothing happens. It just go thru like if it works.

I also use dw_1.object.ole_1.NeedleValue = 123 then I get "Error accessing external object property NeedleValue at line xxx".

Also I attached the ocx just in case somebody have a chance and give me an advice.

I will appreciate any input.

Regards,

  Clarence A

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

If I use the ole directly in a the window I have no problem accessing any of the properties of the OLE object.

Former Member
0 Kudos

Yes. If I place the ole object in the window I have no problem accessing the properties of the Ole_1.

Is there a way to create a child ole like we create the childdatawindow? and access the properties that way?

Former Member
0 Kudos

If you use the control on a form (outside of a datawindow) are you able to set the needle value?