LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

LPDISPATCH input for acivex-control

Hey,

 

does anybody know if it is possible to wire a lpdispatch to pass an object handle as a parameter of an activex-control?

 

What i am trying is to use the MS ScriptControl ActiveX. I try to give my application an Scrptengine by using the ScriptControl.

As i tried to call the AddObject() Method i found that one paramater is of type LPDISPATCH. So how can I give this Method an object handle by using LPDISPATCH?

 

scriptcontrol.png

 

Regards

0 Kudos
Message 1 of 6
(3,553 Views)
LabVIEW can pass the returned LPDISPATCH as a variant from one activeX method to another.
0 Kudos
Message 2 of 6
(3,529 Views)
I'm not at all sure that this will really work, but have you tried to wire the LabVIEW ActiveX refnum of the according class directly to the variant input? LabVIEW can and does make a lot of implicit conversion automatically when using variants. The problem here might be that an application can pass either an IDispatch pointer or an IUnknown pointer the the ActiveX method and unless the Type Library clearly specifies that it wants an IDispatch*, LabVIEW can only guess what it should do and has a 50% chance to get it wrong.
Rolf Kalbermatter
My Blog
0 Kudos
Message 3 of 6
(3,521 Views)

> LabVIEW can pass the returned LPDISPATCH as a variant from one activeX method to another.

But which method should i use to get the LPDISPATCH of my element?

 

> I'm not at all sure that this will really work, but have you tried to wire

> the LabVIEW ActiveX refnum of the according class directly to the variant input?

 Hmm, i did not manage to runit, i always get Error 91. Do you have an example code snippet?

 

Thanks for any hints.

Maybe there is some other way to get my application a script engine?

 

Regards

Ronny

0 Kudos
Message 4 of 6
(3,487 Views)

Well you have from somewhere to instantiate that script engine object. Where and how I can't tell you as I do not know that software but it is most likely another ActiveX class in your automation server interface. Once you have that just wire the refnum to your object input.

 

As to scripting alternatives, you could look into LabPython which I have created a long time ago, and should work at least with the 2.4 until 2.6 versions of Python or you can take a look at http://luaview.esi-cit.com for integration of Lua into a LabVIEW application.

Message Edited by rolfk on 05-18-2010 10:47 PM
Rolf Kalbermatter
My Blog
0 Kudos
Message 5 of 6
(3,485 Views)
This is what I meant to try, but how you create your script engine object or whatever this method expects I can't tell you.
Rolf Kalbermatter
My Blog
0 Kudos
Message 6 of 6
(3,478 Views)