Hallo Leute,
ich habe ein mir unerklärbares Problem. Ich habe in vb.net Code geschrieben, welcher in Solidworks einige Teile einfügt und einige operationen durchführt. Solidworks ist über einen COM verweis an vb.net angebunden und wir mit swapp = CreateObject("sldworks.Application") als object in die variable swapp gespeichert.
Nun läuft das Program einigemale ohne Probleme durch. Plötzlich aber bleibt es an einer stelle hängen und bringt den Fehler:
System.Runtime.InteropServices.COMException wurde nicht behandelt.
ErrorCode=-2147417851
Message="Ausnahmefehler des Servers. (Ausnahme von HRESULT: 0x80010105 (RPC_E_SERVERFAULT))"
Irgendetwas scheind mit dem COM Object nicht zu stimmen, aber was?
Was genau sagt mir dieser Fehler und wie kann ich ihn vermeiden?
Dieser fehler dritt ab und zu auch an anderen stellen meines Programms auf.
Was mache ich falsch?
Hier das gesamte Ausnahmedetail:
System.Runtime.InteropServices.COMException wurde nicht behandelt.
ErrorCode=-2147417851
Message="Ausnahmefehler des Servers. (Ausnahme von HRESULT: 0x80010105 (RPC_E_SERVERFAULT))"
Source="Interop.SldWorks"
StackTrace:
bei SldWorks.ISelectionMgr.GetSelectedObject6(Int32 Index, Int32 Mark)
bei WindowsApplication1.adscrews.mate_screws(SldWorks swApp) in C:\Dokumente und Einstellungen\Administrator\Eigene Dateien\Visual Studio 2008\Projects\Parabelrechner\Parabelrechner\Programms\adscrews.vb:Zeile 225.
bei WindowsApplication1.swAddStandardScrews.Button1_Click(Object sender, EventArgs e) in C:\Dokumente und Einstellungen\Administrator\Eigene Dateien\Visual Studio 2008\Projects\Parabelrechner\Parabelrechner\Forms\swAddStandardScrews.vb:Zeile 154.
bei System.Windows.Forms.Control.OnClick(EventArgs e)
bei System.Windows.Forms.Button.OnClick(EventArgs e)
bei System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent)
bei System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
bei System.Windows.Forms.Control.WndProc(Message& m)
bei System.Windows.Forms.ButtonBase.WndProc(Message& m)
bei System.Windows.Forms.Button.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.DispatchMessageW(MSG& msg)
bei System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(Int32 dwComponentID, Int32 reason, Int32 pvLoopData)
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.RunDialog(Form form)
bei System.Windows.Forms.Form.ShowDialog(IWin32Window owner)
bei System.Windows.Forms.Form.ShowDialog()
bei WindowsApplication1.main.Button1_Click_1(Object sender, EventArgs e) in C:\Dokumente und Einstellungen\Administrator\Eigene Dateien\Visual Studio 2008\Projects\Parabelrechner\Parabelrechner\Forms\main.vb:Zeile 265.
bei System.Windows.Forms.Control.OnClick(EventArgs e)
bei System.Windows.Forms.Button.OnClick(EventArgs e)
bei System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent)
bei System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
bei System.Windows.Forms.Control.WndProc(Message& m)
bei System.Windows.Forms.ButtonBase.WndProc(Message& m)
bei System.Windows.Forms.Button.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.DispatchMessageW(MSG& msg)
bei System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(Int32 dwComponentID, Int32 reason, Int32 pvLoopData)
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(ApplicationContext context)
bei Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.OnRun()
bei Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.DoApplicationModel()
bei Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.Run(String[] commandLine)
bei WindowsApplication1.My.MyApplication.Main(String[] Args) in 17d14f5c-a337-4978-8281-53493378c1071.vb:Zeile 81.
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:
Anbei noch ein Screenshot den ich im Kompiler erstellt habe.
Ich hoffe Ihr könnt mir helfen.
Eine Antwort auf diesen Beitrag verfassen (mit Zitat/Zitat des Beitrags) IP