Alex Elliott Posted January 25, 2007 Report Share Posted January 25, 2007 I have used LabVIEW to build a standalone exe that is an ActiveX Server. I have no problem connecting to this server (either with another LabVIEW vi or with Visual Basic) and I have no problem getting and setting the values of controls on the front panel, with the exception of the control I'm most interested in, which is an ActiveX refnum indicator. When I call "GetControlValue" using the name of the ActiveX refnum indicator and it is empty, then I correctly get an empty refnum returned. When the indicator holds an actual COM object refnum, then the GetControlValue invoke node returns error -2147418113 (aka 0x8000FFFF, which is the generic COM error E_UNEXPECTED). My question is - can I expect LabVIEW to marshall third-party COM dispatch interfaces through its ActiveX Server methods? And if so, what do I need to do to make it happen? Quote Link to comment
Rolf Kalbermatter Posted January 26, 2007 Report Share Posted January 26, 2007 My question is - can I expect LabVIEW to marshall third-party COM dispatch interfaces through its ActiveX Server methods? And if so, what do I need to do to make it happen? I don't think LabVIEW in itself supports marshalling of arbitrary COM interfaces through its ActiveX interface. That would be a whole bunch of extra code to make it generic enough to support all possible datatypes. Rolf Kalbermatter Quote Link to comment
Alex Elliott Posted January 26, 2007 Author Report Share Posted January 26, 2007 I don't think LabVIEW in itself supports marshalling of arbitrary COM interfaces through its ActiveX interface. That would be a whole bunch of extra code to make it generic enough to support all possible datatypes. I'm not asking for marshalling arbitrary interfaces - all that LabVIEW would have to do is to marshall a generic IDispatch pointer. Once the client process has the IDispatch pointer, then the third-party application is responsible for all handling the QueryInterface calls and stuff. I can do the equivalent marshalling of a generic interface in C++ in about three lines of code (Line 1: AddRef, Line 2: cast to LPDISPATCH, Line 3: return to caller). I'm definitely a LabVIEW newbie, but I'm a COM old hat, so I know exactly what needs to be done, just not how to do it. [edited] I should also add that when I try to do the same thing locally through VI Server (i.e., have a client VI fetch an arbitrary COM interface from a Refnum indicator in another VI in the same process with the Ctrl Val.Get command), it works just fine. But I can't get the equivalent functionality to work across processes through the ActiveX Server. Quote Link to comment
Yair Posted January 27, 2007 Report Share Posted January 27, 2007 Brian Tyler is the head of the LV team responsible for these things and likes these questions. You could try dropping him an email through his blog (called Lycangeek) or post in the NI LabVIEW board, where he's likely to see it. Quote Link to comment
Rolf Kalbermatter Posted January 28, 2007 Report Share Posted January 28, 2007 [edited] I should also add that when I try to do the same thing locally through VI Server (i.e., have a client VI fetch an arbitrary COM interface from a Refnum indicator in another VI in the same process with the Ctrl Val.Get command), it works just fine. But I can't get the equivalent functionality to work across processes through the ActiveX Server. You misunderstand VI server a bit here. VI server is the actual core functionality directly operating on the LabVIEW object hierarchy. LabVIEW objects have absolutely nothing to do with COM at all. LabVIEW to LabVIEW communication on VI server level happens through a LabVIEW private TCP/IP protocol and should support the same features except the ones that are limited on purpose for security reasons. The LabVIEW ActiveX server interface is just a wrapper around the VI server interface and I'm sure some of the COM concepts map better to the VI server object model than others. But considering your NI icon I would say you should definitely contact Lucyangeek aka Brian Tyler who is very proficient with .Net and ActiveX functionality and how it is implemented and used in LabVIEW. Rolf Kalbermatter Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.