LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

closing .net and active-x references

Hi,

 

I'm in a little trouble with "close reference.vi".  Suppose, I have an active-x or .net references, and:

  • When do I have to close these references?
  • Do I have to close them?
  • What does happen when I close them?
  • What could happen if I dont close them?
  • All Opened references must be closed?

And an example:

 

Suppose, I have a .net / active-x ref. and an invoke/property node call returns a new reference. Can I close the parent reference earlier then a called reference?

 

I have many questions about this topic, so I think the best could be if someone suggest me a good topic e-book or community blog maybe I can find some useful advices!

 

Thank you so much!

---
+++ In God we believe, in Trance we Trust +++
[Hungary]
0 Kudos
Message 1 of 4
(2,406 Views)

  • When do I have to close these references?
  • When you done wlith it.
  • Do I have to close them?
  • Yes.  You do.
  • What does happen when I close them?
  • Release allocated memory.
  • What could happen if I dont close them?
  • Could casue memory leak.
  • All Opened references must be closed?
  • Yes.

And an example:

 

Suppose, I have a .net / active-x ref. and an invoke/property node call returns a new reference. Can I close the parent reference earlier then a called reference?

Keep parent ref open, until all child ref closed.

 

I have many questions about this topic, so I think the best could be if someone suggest me a good topic e-book or community blog maybe I can find some useful advices!

See LabVIEW menu.

 

George Zou
0 Kudos
Message 2 of 4
(2,399 Views)

I have seen it stated that if the reference number does not change between instances of an application, it does not need to be closed.  I have seen it where certain property node references do not change.  What or how it is determined to use the same reference number, I don't know.  But I have gotten into the habit of closing them anyway.  Your parent reference should be the last reference closed (close them in the reverse order they are opened).

Perhaps someone else can better explain how reference numbers are allocated and why some don't change and others do.

-----------------------------------------------------------------------------------------
Reese, (former CLAD, future CLD)

Some people call me the Space Cowboy!
Some call me the gangster of love.
Some people call me MoReese!
...I'm right here baby, right here, right here, right here at home
Message 3 of 4
(2,389 Views)

All ActiveX and .NET references should be closed - even ones that you do not explicitly open, such as references returned by ActiveX and .NET property nodes.  References to LabVIEW items - such as front panel controls - do not need to be explicitly closed.  See this discussion for more information: http://forums.ni.com/t5/LabVIEW/Which-references-need-to-be-Closed/m-p/307175

 

0 Kudos
Message 4 of 4
(2,373 Views)