|
|
|
#1 |
|
Registered User
Join Date: Jun 2011
Posts: 25
|
Hi,
I try to deal with an ActiveX wich have a writable property that appear like this in the ActiveX Info tool: Outputstate(Index asNumber) as Boolean I understand it like this: Outputstate(Index asNumber, Outputstate as Boolean) My problem is how to set this property to true with ActiceX.setProperty? I tried several ways but nothing work: - ssCore.ActiveX.setProperty({Object:"MyActivex, property:"Outputstate", value:true} - ssCore.ActiveX.setProperty({Object:"MyActivex, property:"Outputstate", value:0} - ssCore.ActiveX.setProperty({Object:"MyActivex, property:"Outputstate(0)", value:true} - ssCore.ActiveX.setProperty({Object:"MyActivex, property:"Outputstate", value:[0,true]} - ssCore.ActiveX.setProperty({Object:"MyActivex, property:"Outputstate", value:"0,true"} - ssCore.ActiveX.setProperty({Object:"MyActivex, property:"Outputstate", value:{Index:0, OutputState:true}} How to Deal with properties that have more than one parameter? Any idea? Thanks |
|
|
|
|
|
#2 |
|
Tim
Join Date: May 2001
Location: Ottawa
Posts: 11,873
|
Properties can be read-only, write-only or read/write. What it really tells you is whether there is a just a "setter" method, just a "getter" method or both.
The "setter" method looks like this: Outputstate(Index as Number, value as Boolean) The "getter" method looks like this: Outputstate(Index as Number) as Boolean That's basically why there is an ActiveX.getProperty and an ActiveX.setProperty, they call different methods on the underlying object. The functionality you need Can't use arguments with ActiveX getPropery/setProperty was added/fixed in 3.7 build 197 so as long as you're using that (or something newer) you should be able to pass the Index to the ActiveX.setProperty call as well, like this... ssCore.ActiveX.setProperty({Object:"MyActivex, property:"Outputstate", Index:0, value:true} |
|
|
|
|
|
#3 |
|
Registered User
Join Date: Jun 2011
Posts: 25
|
Thanks a lot for your answer.
Sorry for asking a question that be resolved long time ago. |
|
|
|
|
|
#4 |
|
Registered User
Join Date: Jun 2011
Posts: 25
|
Hi,
I tried it this afternoon with no success: result = ssCore.ActiveX.setProperty({Object:"MyActivex, property:"Outputstate", Index:0, value:true} --> result.success return false --> result.result return nothing result = ssCore.ActiveX.getProperty({Object:"MyActivex, property:"Outputstate", Index:0} --> result.success return false --> result.result return nothing Get or Set property without argument works fine. |
|
|
|
|
|
#5 |
|
Tim
Join Date: May 2001
Location: Ottawa
Posts: 11,873
|
Did you check to see what kind of error was returned in result.Error.description?
What do you mean "Get or Set property without argument works fine"? If it "works fine" then what's the problem? Do you mean other get/set property calls work? I really don't want to play 20 questions with you over several weeks so why don't you tell me what OCX you're trying to use and what you're trying to do so I can help instead of just guessing? |
|
|
|
|
|
#6 |
|
Registered User
Join Date: Jun 2011
Posts: 25
|
Hi,
ok I will do my best to be more clear. I don't wanna waste your time. 1 - Yes I checked "result.Error.description". It returned "Unexpected error". 2 - Yes I mean other get/set property calls works fine. My problem is focused on properties with multiple arguments. 3 - The OCX I try to use is "PhidgetInterfaceKit Class". You can get it here: http://www.phidgets.com/drivers.php. Although obviously, it only work if hardware is connected. What I wanna do is very simple, it is to read and change the status of or more output of a Phidgets relay board. Thanks |
|
|
|
|
|
#7 | |
|
Tim
Join Date: May 2001
Location: Ottawa
Posts: 11,873
|
Quote:
I think I wrote a simple OCX to test properties with parameters. If I can find that I'll send it over (or I'll recreate it), along with a test FLA so we can compare notes. |
|
|
|
|