Christian Butcher Posted April 4, 2017 Report Share Posted April 4, 2017 Firstly, I'm reposting from the NI Forums here: Programatically reinsert an ActiveX Container TL;DR: My goal is to programmatically carry out whatever happens when I right click on an ActiveX container and choose the option 'Insert ActiveX Object...'. Ideally, I would like to avoid using VI Scripting to do this, but I haven't gotten anywhere so far and so really any solution will be a step forwards. My most recent attempt (I'm using NI's Actor Framework) has been to place the ActiveX container on an Actor Core panel, then use Pre-Launch Init to open a Static VI Reference, and resize the front panel, with the container set to scale with the front panel. This doesn't work, because the static reference doesn't refer to the same thing that the AF then opens using the Launch Actor VI, but ignoring that problem, it also doesn't help with resizing the container. Previously, I manually resized the container, but this I could only do after it was in existence, and so the object was already inserted. My current observation seems to be that after I choose the ActiveX object to insert, there is little/nothing I can do to change the size of the object (I can change the container, but this doesn't do anything to the object - probably the object isn't very friendly-ly coded, but I can't do anything about that...). Consequently, I come back to my goal, which is to call some Invoke Node or similar, to 'Insert ActiveX Object...'. Is there some way to do this? I don't intend to do it often, so long execution times, recompilation of VIs, shooting a cow over the moon are all fine if needed. Quote Link to comment
bbean Posted April 5, 2019 Report Share Posted April 5, 2019 Did you have any luck with solving this issue? I'd like to do the same thing. Quote Link to comment
bbean Posted April 5, 2019 Report Share Posted April 5, 2019 never mind. found a work around to my problem. I was getting runtime errors whenever I saved my VI with the activex control saying the control doesn't support persistence. I fixed by saving a null variant to a connection property before exiting the vi and the problem went away 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.