ich habe in Eclipse über das UNO Plugin ein neues UNO-IDL Projekt erstellt. Es lässt sich kompilieren und exportieren. Beim Export wird es über den Extension Manager von Open Office importiert.
Das is alles bestens. Nur wenn ich jetzt über ein Makro versucht darauf zuzugreifen, bekomm ich eine Null-Objekt.
Code: Alles auswählen
sub CallJava
Dim dialog as Object
dialog = createUnoService( "org.openoffice.example.TestUno" )
dialog.openDialog()
end sub
Code: Alles auswählen
public final class TestUnoImpl extends WeakBase
implements com.sun.star.lang.XServiceInfo,
org.openoffice.example.XTestUno
{
private final XComponentContext m_xContext;
private static final String m_implementationName = TestUnoImpl.class.getName();
private static final String[] m_serviceNames = {
"org.openoffice.example.TestUno" };
public TestUnoImpl( XComponentContext context )
{
m_xContext = context;
};
public static XSingleComponentFactory __getComponentFactory( String sImplementationName ) {
XSingleComponentFactory xFactory = null;
if ( sImplementationName.equals( m_implementationName ) )
xFactory = Factory.createComponentFactory(TestUnoImpl.class, m_serviceNames);
return xFactory;
}
public static boolean __writeRegistryServiceInfo( XRegistryKey xRegistryKey ) {
return Factory.writeRegistryServiceInfo(m_implementationName,
m_serviceNames,
xRegistryKey);
}
// com.sun.star.lang.XServiceInfo:
public String getImplementationName() {
return m_implementationName;
}
public boolean supportsService( String sService ) {
int len = m_serviceNames.length;
for( int i=0; i < len; i++) {
if (sService.equals(m_serviceNames[i]))
return true;
}
return false;
}
public String[] getSupportedServiceNames() {
return m_serviceNames;
}
// org.openoffice.example.XTestUno:
public void openDialog()
{
// TODO: Insert your implementation for "openDialog" here.
}
}
Also was ist hier falsch.
Gruss Carsten