Showing results for 
Search instead for 
Did you mean: 

Java -> COM -> LabView : Need Help

Dear Java Community:

Can anyone suggest why my 20 line Java program below fails at the end?

The "labview50.*" package is generated with Microsoft's "jactivex" tool
on the file LabView/resources/labview50.tbl.

This program actually does bring a labView session alive and can
with the "Application" object.

However, even though the "labView.GetVIReference( )" statement executes
exception or error, ANY attempt to use the return VirtualInstrument
object always
results in the following error:

java.lang.ClassCastException: Illegal cast from class
com/ms/com/CUnknown to
interface labview50/VirtualInstrument. Class does not declare
interface and inter
does not have an IID.

Any Suggestion at all appreciated.

STeve Punte

Equivalent C++ seems to work.

import java.awt.*; // standard java
import java.awt.event.*;
import java.applet.*;
import*; // afc controls
import*; // used for our control host
import*; // general com

import labview50.*;

public class Foo
public static void main(String args[])
// Instantiate a LabView session. Class Application knows the GUID
Application labView = new Application();

// This works.
System.out.println("Application Name = " + labView.getAppName() );

// Load up a VI program
VirtualInstrument vi =
labView.GetVIReference( "C:\\", new"") );

// ALWAYS Bombs here, no matter what member function is attempted.
0 Kudos
Message 1 of 1