How to invoke COM function (ActiveX) in Octave that takes input parameter?

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

How to invoke COM function (ActiveX) in Octave that takes input parameter?

nckhrs
I use Octave 5.1.0 with "windows" package installed (from Octave Forge). I
use it to access COM interface (ActiveX) of a windows app.

I can see the COM functions using:
h = actxserver('MyApp.Application')
com_invoke(h)

I can access COM function that doesn't take any parameter:
com_invoke(h, "GetStatus")

However, for function that takes one parameter, I couldn't find the right
syntax. I have tried these below to no avail:

com_invoke(h, "SetType", 1)
com_invoke(h, "SetType(1)")
com_invoke(h, "SetType", {1})
com_invoke(h, "SetType", ({1}))
com_invoke(h, "SetType[1]")
com_invoke(h, "SetType", [1])
com_invoke(h, "SetType", "1")

I have been searching online, couldn't find any info.

What is the correct way to invoke COM function that takes an input
parameter?



--
Sent from: https://octave.1599824.n4.nabble.com/Octave-General-f1599825.html


Reply | Threaded
Open this post in threaded view
|

Re: How to invoke COM function (ActiveX) in Octave that takes input parameter?

PhilipNienhuis
nckhrs wrote

> I use Octave 5.1.0 with "windows" package installed (from Octave Forge). I
> use it to access COM interface (ActiveX) of a windows app.
>
> I can see the COM functions using:
> h = actxserver('MyApp.Application')
> com_invoke(h)
>
> I can access COM function that doesn't take any parameter:
> com_invoke(h, "GetStatus")
>
> However, for function that takes one parameter, I couldn't find the right
> syntax. I have tried these below to no avail:
>
> com_invoke(h, "SetType", 1)
> com_invoke(h, "SetType(1)")
> com_invoke(h, "SetType", {1})
> com_invoke(h, "SetType", ({1}))
> com_invoke(h, "SetType[1]")
> com_invoke(h, "SetType", [1])
> com_invoke(h, "SetType", "1")
>
> I have been searching online, couldn't find any info.
>
> What is the correct way to invoke COM function that takes an input
> parameter?

I'm afraid you have abetter chance for anwers on the various microsoft
developers site(s) for answers, notably for ActiveX, VB (Visual Basic)  and
COM.
Or ask on stackoverflow.

I got several potentially good hits with a search for "Activex actxserver
parameters".

Philip




--
Sent from: https://octave.1599824.n4.nabble.com/Octave-General-f1599825.html


Reply | Threaded
Open this post in threaded view
|

Re: How to invoke COM function (ActiveX) in Octave that takes input parameter?

nckhrs
Thanks Philip.

It's not actxserver parameter though. It's just accessing a function that
has parameter.
I can use Matlab (on my friend's computer) and it's fairly straight forward.

It's just I couldn't figure out the right syntax for Octave.



--
Sent from: https://octave.1599824.n4.nabble.com/Octave-General-f1599825.html


Reply | Threaded
Open this post in threaded view
|

Re: How to invoke COM function (ActiveX) in Octave that takes input parameter?

nckhrs
Update:

I found that I didn't declare my COM function properly in my application
(the parameter part).

This syntax work:
com_invoke(h, "SetType", 1)



--
Sent from: https://octave.1599824.n4.nabble.com/Octave-General-f1599825.html