Actor Framework Discussions

cancel
Showing results for 
Search instead for 
Did you mean: 

Using ActiveX controls in Actor Core problems

Solved!
Go to solution

Hi,

I have one actor that has a windows media player activeX control on its front panel of the the Actor Core VI that plays a video (or does other stuff). Primary it is an activeX and has an automation refnum - that is what counts.

Launching new actors of this actor at the same time creates more of these and each work and play their video - just as it should do. Each new actor has created a new ActiveX object and their automation ref is new. Splendid.

The issue comes however if I stop one (or more) of the running actors and after one (or more) have stopped launch a new actor.

The Actor Core has "shared clone reentrant execution" and the issue here is that it is reusing some of the "old", closed Actor that was previously stopped.

Instead of creating a totally new ActiveX object, and a new automation refnum, it reuses something of the old one and keeps the same automation refnum of one of the previously closed actors.

This sort of makes the ActiveX simply not work.

I have tried to put "request deallocation" in the actor core VI - however still to no success. I am closing all refnums at stop core aswell.

I have a deadline on this and hate it when such tiny %¤&#¤ starts getting in the way and am in the process of throwing my laptop out of the window due to plain rage.

Am currently looking at at trying to find dirty workarounds like having a subpanel at the actor core and there show a pre-allocated re-entrant VI with a new activeX object. still havent made this work, but before I do, I was hoping perhaps someone has some better ideas on how to solve this?

Thanks in advance!

Message 1 of 4
(3,804 Views)
Solution
Accepted by topic author Corny

Well, this doesn't sound like anything special to the Actor Framework, first of all.

The easiest thing that I would try would be to copy your Actor Core.vi front panel to a new member VI... let's call it "Workaround.vi". Move your UI loop off of Actor Core.vi and into Workaround.vi. Make that Workaround.vi be preallocated reentrant and then on the block diagram of Actor Core, use Open VI Ref with 0x8 to get a new instance and then use Call By Ref to invoke it, passing into it anything it needs from Actor Core.

This kind of surgery is relatively painless. Usually takes me about 15 minutes regardless of the complexity of the original VI [I've had to do this many times for things that are NOT bugs in LabVIEW but simply because I needed better control of my UI and needed to host it on a separate VI from the VI that was being invoked by callers.]

Message 2 of 4
(3,332 Views)

thanks,

Good solution.

Btw.: It took less than 10 mins to do it

Guess when you get frustrated due to deadlines you stop thinking clearly.

0 Kudos
Message 3 of 4
(3,332 Views)

> Btw.: It took less than 10 mins to do it

Bragging!!! Maybe we should have this bit of refactoring as one of the speed programming questions at NIWeek! 🙂

Message 4 of 4
(3,332 Views)