06-07-2010 10:40 AM
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")
Yet when I select the IRemoteInterface2 the reference that is selected in LabVIEW is the first one (IRemoteInterface).
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
Solved! Go to Solution.
06-07-2010 11:33 AM
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.
06-08-2010 03:18 AM
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.