.NET-Programmierung

  • #1
R

ramiko

Neues Mitglied
Themenersteller
Dabei seit
09.03.2011
Beiträge
1
Reaktionspunkte
0
Hallo Leute,

ich versuche mich an einer Schnittstelle zu OpenOffice, bei der ich ein Addin ggf. laden muss, falls es noch nicht installiert ist. Dafür soll laut Dokumentation der ExtensionManager zur Verfügung stehen.
Ich schaffe es, die grundsätzlich in VBNet erforderlichen Objekte zu instanzieren, das eigentliche Laden erzeugt jedoch immer eine Exception:

unoidl.com.sun.star.deployment.DeploymentException wurde nicht behandelt.
Message=Fehler beim Hinzufügen von: RAWriter, Writer Extension für ra-micro. Version
Source=mscorlib
StackTrace:
Server stack trace:
Exception rethrown at [0]:
bei System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)
bei System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type)
bei unoidl.com.sun.star.deployment.XExtensionManager.addExtension(String url, NamedValue[] properties, String repository, XAbortChannel xAbortChannel, XCommandEnvironment xCmdEnv)
bei OWriter.modOWriter.test() in E:\Migration\ramicro\source\applications\1-office\RAOWriter\RAOWriter\modOWriter.vb:Zeile 66.
bei OWriter.modOWriter.Starting() in E:\Migration\ramicro\source\applications\1-office\RAOWriter\RAOWriter\modOWriter.vb:Zeile 28.
bei OWriter.frmStartForm.frmStartForm_Load(Object sender, EventArgs e) in E:\Migration\ramicro\source\applications\1-office\RAOWriter\RAOWriter\Formulare\frmStartForm.vb:Zeile 31.
bei System.Windows.Forms.Form.OnLoad(EventArgs e)
bei System.Windows.Forms.Form.OnCreateControl()
bei System.Windows.Forms.Control.CreateControl(Boolean fIgnoreVisible)
bei System.Windows.Forms.Control.CreateControl()
bei System.Windows.Forms.Control.WmShowWindow(Message& m)
bei System.Windows.Forms.Control.WndProc(Message& m)
bei System.Windows.Forms.ScrollableControl.WndProc(Message& m)
bei System.Windows.Forms.ContainerControl.WndProc(Message& m)
bei System.Windows.Forms.Form.WmShowWindow(Message& m)
bei System.Windows.Forms.Form.WndProc(Message& m)
bei System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
bei System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
bei System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
bei System.Windows.Forms.UnsafeNativeMethods.SendMessage(HandleRef hWnd, Int32 msg, Int32 wParam, Int32 lParam)
bei System.Windows.Forms.Form.SetVisibleCore(Boolean value)
bei System.Windows.Forms.Control.set_Visible(Boolean value)
bei System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)
bei System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
bei System.Windows.Forms.Application.Run(Form mainForm)
bei OWriter.frmStartForm.Main() in E:\Migration\ramicro\source\applications\1-office\RAOWriter\RAOWriter\Formulare\frmStartForm.Designer.vb:Zeile 0.
bei System.AppDomain._nExecuteAssembly(Assembly assembly, String[] args)
bei System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
bei Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
bei System.Threading.ThreadHelper.ThreadStart_Context(Object state)
bei System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
bei System.Threading.ThreadHelper.ThreadStart()
InnerException:

Hier mal der verwendete Code:

Dim oNV(0) As unoidl.com.sun.star.beans.NamedValue
Dim oM As unoidl.com.sun.star.deployment.XExtensionManager
Dim oCE As unoidl.com.sun.star.ucb.XCommandEnvironment
Dim oP As unoidl.com.sun.star.deployment.XPackage
Dim sP As String

oM = clsOWriter.ExtensionManager
oCE = clsOWriter.ServiceFactory.createInstance(com.sun.star.ucb.CommandEnvironment)
sP = IO.Path.GetDirectoryName(Reflection.Assembly.GetExecutingAssembly.Location) + IO.Path.DirectorySeparatorChar
sP += RAWriter.oxt
oP = oM.addExtension(clsOWriter.ConvertToURL(sP), oNV, shared, oM.createAbortChannel(), oCE)

Hat einer von euch eine Peilung, was schief läuft bzw. wie ich die Methoden verwenden muss? Bin schon langsam aber sicher am Verzweifeln. Das Addin lässt sich problemlos über Extras - Extension Manager des OpenOffice Writer installieren. Nach dem Laden wird noch eine Lizenzvereinbarung angezeigt, die abgenickt werden muss. Ab dann steht das Addin zu Verfügung.

Gruß Michael
 
Thema:

.NET-Programmierung

ANGEBOTE & SPONSOREN

Statistik des Forums

Themen
113.840
Beiträge
707.966
Mitglieder
51.494
Neuestes Mitglied
Flensburg45
Oben