Jump to content

How to get XControlLibrary reference from XControl Instance


Jim Kring

Recommended Posts

Does anyone know how to detect whether a VI is calling an XControlLibrary instance (an XControl) and obtain a reference to the XControlLibrary? The XControlLibrary does not show up as in the callees list. It is possible to test all Front Panel controls using the XContro::Is XControl? property but this does not give any information about or link to the XControlLibrary. It is also possible to get this info from the linker info on disk, but I would like to do this all using VI Server, in memory.

Link to comment

QUOTE(Jim Kring @ Feb 18 2007, 12:59 AM)

Does anyone know how to detect whether a VI is calling an XControlLibrary instance (an XControl) and obtain a reference to the XControlLibrary? The XControlLibrary does not show up as in the callees list. It is possible to test all Front Panel controls using the XContro::Is XControl? property but this does not give any information about or link to the XControlLibrary. It is also possible to get this info from the linker info on disk, but I would like to do this all using VI Server, in memory.

I don't have a complete answer to you. I did'n quite get it where from did you try to get the XControl reference. From VI where the XC instance is located? Anyhow, you can find out which XControl your control is by getting it's class name using property node. You can find which libraries are in memory of all the applications using property All Libraries in memory of Application. But I still don't know how to get a reference to the library unless you also know the path of the library. If you know the path of the XControl, then it's easy. If you know the name of a Facade.vi then you can open a VI reference to Facade directly from memory by wiring the long name to open VI reference. But I assume you don't in general know this information.

Jim, tell me more about the linker info on the disk. What is it and where can I find it and how can I use it.

Tomi

Link to comment

Thanks Jim,

You can get link from a VI to the XControl library:

XControlName=Control.Class Name AllVIs=Application.All VIs in Memory For each VI in AllVIs {   if (VI match XControlName) resultVI=VI }  XControlLibrary = resultVI.Library

You can get the link from an XControl to Owning VI

ContainerState.Refnum.OwningVI

Tomi

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.