在c#.net中调用VC++做的ocx。 对象可以调用,但是却无法调用对象的方法啊。谁碰到过这种情况? 能否解答一下呢?【附 出错的堆栈跟踪】堆栈跟踪: 
[COMException (0x8000ffff): 灾难性故障]
System.RuntimeType.ForwardCallToInvokeMember(String memberName, BindingFlags flags, Object target, Int32[] aWrapperTypes, MessageData& msgData) +457
NETVIEWXLib.NetViewXClass.set_username(String ) +0
web.WebForm1.ImageButton1_Click(Object sender, ImageClickEventArgs e) in c:\inetpub\wwwroot\web\webform1.aspx.cs:87
System.Web.UI.WebControls.ImageButton.OnClick(ImageClickEventArgs e)
System.Web.UI.WebControls.ImageButton.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument)
System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument)
System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData)
System.Web.UI.Page.ProcessRequestMain()

解决方案 »

  1.   

    行 82:    NETVIEWXLib.NetViewXClass nv = new NETVIEWXLib.NetViewXClass();
    行 83: 
    行 84:    nv.username ="123";      //注:执行到这里出错了的。
    行 85:    nv.password = "123";
    行 86:    nv.wServerPort = (short)80;
      

  2.   

    灾难性故障 
    说明: 执行当前 Web 请求期间,出现未处理的异常。请检查堆栈跟踪信息,以了解有关该错误以及代码中导致错误的出处的详细信息。 异常详细信息: System.Runtime.InteropServices.COMException: 灾难性故障
      

  3.   

    activex 控件一般需要容器窗口,无法自己单独运行
      

  4.   

    查看监视的时候:- Cam {NETVIEWXLib.NetViewXClass} NETVIEWXLib.NetViewXClass
    System.Object {NETVIEWXLib.NetViewXClass} System.Object
    buffernum <错误: 发生 {System.Runtime.InteropServices.COMException} 类型的异常> short
    bUseOverlay <错误: 发生 {System.Runtime.InteropServices.COMException} 类型的异常> bool
    channel <错误: 发生 {System.Runtime.InteropServices.COMException} 类型的异常> short
    password <错误: 发生 {System.Runtime.InteropServices.COMException} 类型的异常> string
    servername <错误: 发生 {System.Runtime.InteropServices.COMException} 类型的异常> string
    trantype <错误: 发生 {System.Runtime.InteropServices.COMException} 类型的异常> short
    url <错误: 发生 {System.Runtime.InteropServices.COMException} 类型的异常> string
    username <错误: 发生 {System.Runtime.InteropServices.COMException} 类型的异常> string
    ViewQCIF <错误: 发生 {System.Runtime.InteropServices.COMException} 类型的异常> bool
    wServerPort <错误: 发生 {System.Runtime.InteropServices.COMException} 类型的异常> short
      

  5.   

    activex   控件一般需要容器窗口,无法自己单独运行. 
    能不能说再清楚一点