LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

automation refnum from an activex container

automation refnum from an activex container
Hi all,

I need to get the automation refnum which was created of a listview in an
activex container. But I cannot use any local variables to store the reference
and also cannot wire it because its in a different case of the case structure.

Now I tried to get all controls of the vi by Panel->Controls[]. I get the
activeX container, but what I need is the automation refnum to the listview
inside the container. Can I type cast this? and how?

Any ideas?

Greetings,

-alex
0 Kudos
Message 1 of 5
(2,983 Views)
Hello Alex,

From the reference to the container you will want to use the Value property to get the ActiveX reference.

What is the need to get the reference in this manner and not use a local variable or shift register? If you are trying to use a reference in two different cases you should be able to use a shift register to pass the reference between each call of the case structure and avoid these property nodes.

Please let me know if you have any questions about this.

Regards,

Matt F
0 Kudos
Message 2 of 5
(2,948 Views)
Thx Matt.

I got the refnum. But it did not solve my problem anyway.
You told to use the shift register of a global/local variable, but when I do
that, windows will throw two exceptions at address 0 when I exit the
application. Labview will not show the exception until it is closed. Then the
same thing happens. Two exceptions thrown by windows without any information in
them.

This always happens if I call a VI which contains this ActiveX ListView twice.
Therefore I tried to handle three different cases: "Open", "Close", and
"Update". The ActiveX is now only in the "Open" case. But to update the
listview I need the reference in the "Update" case, too. Using any variable
(global or local) or a while loop with just one iteration to get use of the
shift register the same windows exceptions occur. I thought I will get rid of
this by using the components[]->activexContainer->ListView, but its all the
same. If I use the listView reference in two different calls of the VI the
exceptions occur. but the listview is there. it is not destroyed. because the
callback methods handle the events of the listview and update the right component.

I cannot find the answer but it seems that the reference to the activex is 0
and windows tries to destroy it but cannot because the reference is invalid.

Thx,
Alex.
0 Kudos
Message 3 of 5
(2,938 Views)
Hello Alex,

The behavior you are seeing is probably due to improper handling of the activeX referenece inside your VI. Could you post a small VI that exhibits the behavior for us to look at?
0 Kudos
Message 4 of 5
(2,919 Views)
Matt F schrieb:
> Hello Alex,<br><br>The behavior you are seeing is probably due to improper handling of the activeX referenece inside your VI. Could you post a small VI that exhibits the behavior for us to look at?
Well, the application is a really big one. To snip out a code sample would not
be possible. I tried to reproduce this problem in an example, but there it did
not occur.
But after reconstructing the complete thing for about 10 times with different
constructions I managed it to work properly. But I don't know why it works now.
sorry for that.

But many thanks for your response and feedback.

Greetings, Alex.
0 Kudos
Message 5 of 5
(2,896 Views)