灾难性故障 (异常来自 HRESULT:0x8000FFFF (E_UNEXPECTED))
哪位高手帮帮忙,我在WINFORM中直接调用东软的OCX控件,没有什么问题。
但是现在想专门写个类,来调用OCX,结果就出现下面的错误。请各位高手帮帮忙了。
不胜感激!
灾难性故障 (异常来自 HRESULT:0x8000FFFF (E_UNEXPECTED))
未处理 System.Runtime.InteropServices.COMException
Message="灾难性故障 (异常来自 HRESULT:0x8000FFFF (E_UNEXPECTED))"
Source="mscorlib"
ErrorCode=-2147418113
StackTrace:
在 System.RuntimeType.ForwardCallToInvokeMember(String memberName, BindingFlags flags, Object target, Int32[] aWrapperTypes, MessageData& msgData)
在 ESACTIVEXLib.ESActiveXClass.Disconnect(String bstrID)
在 ToDll.Class1.Connect(String bstrID, String bstrEquType, String bstrChannel, String bstrChannelInfo, String bstrAssisParam) 位置 E:\C#OCX\TestOCX\ToDll\Class1.cs:行号 16
在 TestOCX.Form1.button18_Click(Object sender, EventArgs e) 位置 E:\C#OCX\TestOCX\TestOCX\Form1.cs:行号 436
在 System.Windows.Forms.Control.OnClick(EventArgs e)
在 System.Windows.Forms.Button.OnClick(EventArgs e)
在 System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent)
在 System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
在 System.Windows.Forms.Control.WndProc(Message& m)
在 System.Windows.Forms.ButtonBase.WndProc(Message& m)
在 System.Windows.Forms.Button.WndProc(Message& m)
在 System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
在 System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
在 System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
在 System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg)
在 System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(Int32 dwComponentID, Int32 reason, Int32 pvLoopData)
在 System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)
在 System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
在 System.Windows.Forms.Application.Run(Form mainForm)
在 TestOCX.Program.Main() 位置 E:\C#OCX\TestOCX\TestOCX\Program.cs:行号 17
在 System.AppDomain.nExecuteAssembly(Assembly assembly, String[] args)
在 System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
在 Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
在 System.Threading.ThreadHelper.ThreadStart_Context(Object state)
在 System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
在 System.Threading.ThreadHelper.ThreadStart()