LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

non creatable class

Hi guys and gals,

 

I have a tangle of a mess here!  Let me start from the beginning.  I have a typelib on my computer called "xTInstrument component library version 1.0"  I opened the .dll containing the typelib in OLE/VIEW and discovered that the classes I need to use are "non-createable" coclasses mixed in with interfaces.  For example, the class I want to use is called "Electron Beam" and it has a property called "HV" which has a method called "SetTargetValue"  So I dropped an "Automation Open" vi on the block diagram and wired it all up.  When I go to run the program I get the following error "Class not registered in Test.vi"  To find out what dlls Labview was calling, I used Process Monitor and watched what it was looking for.  I found and registered all the dlls using "regsvr32.exe dll."  Now this is where it gets wierd.  After registering the dlls, the program still tripped the "Class not registered in Test.vi" error, so I decided to use Process Monitor to check what CLSID were being called.  I then searched my registry for the CLSID my LabVIEW program was calling.  I found all the CLSIDs except the ones from the non-creatable classes.  Is there anyway in LabVIEW to call these "non-creatable" classes?

0 Kudos
Message 1 of 9
(3,568 Views)

Hi shivels,

 

I did some research into non-creatable classes and this is what I found out.  A non-creatable class (Microsoft terms them "PublicNotCreatable") is available externally but cannot be instantiated externally.  Instead, the object is instantiated indirectly though fucntions, such as a Get function.  The reasoning that I can see is that there may be dependencies on other objects so the order in which the objects are instantiated is important.  By making a class PublicNotCreatable, the developer can force the user to programmatically construct the objects through calling a Get method. 

 

 I did uncover a Microsoft bug report regarding PublicNonCreatable classes:  http://support.microsoft.com/kb/244544

 

Also, here is Microsoft's definition:(http://msdn.microsoft.com/en-us/library/aa242107%28VS.60%29.aspx)

 

PublicNotCreatable means that other applications can use objects of this class only if your component creates the objects first. Other applications cannot use the CreateObject function or the New operator to create objects from the class.

 

What I suspect in your situation is that the Electron Beam may be a PublicNotCreatable class object, so a get function would be required.  

 

I hope this helps. Let me know if you have any further questions!

 

Kristen H.

Message 2 of 9
(3,539 Views)

Hi Kristen,

 

I think I"m starting to understand the ActiveX Classes in LabVIEW.  I have a question about calling a typelib.  I have a typelib called "QuantaInstrumentBrickLib"  When I select this ActiveX Class, it contains only one creatable class, "CoQuantaFEGInstrumentBrick".  I'm alittle confused because it has no properties or methods, which leads me to believe this is the instantiation class, because I have another typelib called "Quanta Instrument component library."  Would it be possible to use a sequence structure and make case "0" the ActiveX Automation Open for "CoQuantaFEGInstrumentBrick" then make case "1" the location where I call the classes for the "Quanta Instrument component library"?  Or would I have to do some kind of typecast to call the classes?

 

Cheers,

Shivels

0 Kudos
Message 3 of 9
(3,523 Views)

You should try the ActiveX container on the FP, some ActiveX components (i think they are called 'ActiveX controls') are not available through the Automation Open function but have to be directly placed on the window.

 

Felix

Message 4 of 9
(3,517 Views)

Hi Felix,

 

I tried doin the container thing, but when I do, it just puts a box on the front panel with a folder with an "x" icon inside the box and prints the name of the .ocx file below it.  I'll admit, my knowledge of ActiveX controls is very, very limited.  I think I have to typecast the "non-creatable" classes to objects that use the objects but I have know idea how to do this.

0 Kudos
Message 5 of 9
(3,496 Views)

There is a right-click option like 'Select ActivX Class...' (I do not remember the correct name) which allows you to browse through the possible ActiveX controls.

 

Felix

0 Kudos
Message 6 of 9
(3,484 Views)

Hi shivels,

 

Here are some more resources about ActiveX:

 

ActiveX and LabVIEW

 ActiveX and COM -- Part I

ActiveX and COM -- Part II

I hope this helps!

 

Kristen H.

0 Kudos
Message 7 of 9
(3,476 Views)

hi,

 have been doing a project on the 8051 muc kit. now we need to display the contents on the labview. how do i interface my kit using visa protocol?? 

0 Kudos
Message 8 of 9
(3,231 Views)

Hi JJDVH,

 

I am not positive on the capabilities of the 8051 microcontroller and would like to know if the manufacturer has specified that it will communicate through the VISA protocol.  If so, what version of NI VISA do you have and what version of LabVIEW do you have?

 

Thanks

Ryan T
National Instruments
Applications Engineer
0 Kudos
Message 9 of 9
(3,190 Views)