ni.com is currently undergoing scheduled maintenance.

Some services may be unavailable at this time. Please contact us for help or try again later.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Object specified is not creatable in my Open reference

Solved!
Go to solution

I'm having a problem using a type library file.  The file I'm using shows the object I would like to create as creatable (i.e. it has a dot in front of it and shows up when I check the box "show only creatable objects")

Browse.JPG

Yet when I select the IRemoteInterface2 the reference that is selected in LabVIEW is the first one (IRemoteInterface).

selectClass.JPG

I Then need to go into the reference and select the Interface2 as in the picture above.

When running this I get the error of "Automation Open: Object specified is not creatable in Untitled 1".  I'm wondering if anyone understands what is going on with this error.  The typeLib is registered and a VB project can use this object... here is the VB code:

 

Dim WithEvents Remote As RemoteInterface
Dim Remote2 As IRemoteInterface2 

     .

     .

     .

Private Sub Form_Load()
    ' create the new RemoteInterface
    Set Remote = New RemoteInterface    ' local
    
    Set Remote2 = Remote

     .

     .

     .

End Sub

    .

    .

    .

    Remote2.ExecuteScript (strFile)

    .

    .

    .

Any ideas as to what I can do to get access to the RemoteInterface2 object

0 Kudos
Message 1 of 3
(3,175 Views)

It looks like all these interfaces are implemented using a single coclass (IndiComRemote.RemoteInterface) so try the following:

- Create a RemoteInterface object.

- Use the "Variant To Data" primitive to query for your desired interface, IRemoteInterface2

- If that succeeds, close the IRemoteInterface you obtained first and keep using your IRemoteInterface2 reference.

 

Message 2 of 3
(3,165 Views)
Solution
Accepted by topic author Dave_B

Thanks for the tip about using the variant to data in order to 'convert' or 'access' the other object.  I had tried using the type converter earlier and that caused LabVIEW close immediately.  Here is what the solutioin looks like for accessing the two interfaces.

solution.JPG

 

0 Kudos
Message 3 of 3
(3,147 Views)