Oops... I figured out what was going wrong. I was using Java code generated
by a propietary tool called Silk Pilot, and buried within it was a call to
System.exit in response to an exception. The exception was only happening in
Tcl, not sure why but I have worked out how to generate my own object
references. Here are the details for anyone who's interested.

--------------------------------------------------------------------------
package require java

# Set up arguments for creating an orb reference
set props [java::call System getProperties]
set args [java::new {String[]} 0]

# Create the orb reference
set orb [java::call org.omg.CORBA.ORB init $args $props]

# Get the stringified IOR
set fh [open "/path/to/the/ior/file" r]
set IOR [read $fh]
close $fh

# Create an object reference
set ref [$orb string_to_object $IOR]

# Cast it to the type you want
set ctpif [java::call CtpModule.CtpIfHelper narrow $ref]

# Invoke its methods
$ctpif getCtpNames ...

--------------------------------------------------------------------------
Hugh Dunne, Ciena (formerly Lightera), 10201 Bubb Rd., Cupertino, CA 95014
[EMAIL PROTECTED]                                        +1-408-865-6485

----------------------------------------------------------------
The TclJava mailing list is sponsored by WebNet Technologies.
To subscribe:    send mail to [EMAIL PROTECTED]  
                 with the word SUBSCRIBE as the subject.
To unsubscribe:  send mail to [EMAIL PROTECTED] 
                 with the word UNSUBSCRIBE as the subject.
To send to the list, send email to '[EMAIL PROTECTED]'. 
A list archive is at: http://www.findmail.com/listsaver/tcldallas/

Reply via email to