locked
Catastrophic failure (Exception from HRESULT : 0x8000FFFF (E_UNEXPECTED))

    Question

  • Hi there

    I tried creating an "activex ocx" object from VB.NET and invoke itz method, but unable to get through and fed up with the following exception.

    Dim MyAccount As Object

    MyAccount = CreateObject("DP.AccountContrl.1")

    MyAccount.Launch() - This is where i get the exception. The error is

    "Catastrophic failure (Exception from HRESULT : 0x8000FFFF (E_UNEXPECTED))"

    Could anyone throw light in resolving this issue

    Thanks in advance
    Sathya ^_^

    Thursday, November 30, 2006 11:38 PM

All replies

  • Hi Sathya,

    Can you post the code you're using on the .NET side?  There's no way to create OCXs in VB.NET, so I'm not sure I entirely understand your question.  Are you trying to make a regular COM component or an actual ActiveX control?  Are you using the Interop UserControl template posted at http://blogs.msdn.com/vbteam?

    Jonathan

    Friday, December 01, 2006 10:13 PM
    Moderator
  •  

    Jonathan I was looking around about this error. I did this application and it was running good but yesterday failed.

    I dont understand well this error. But I see the post and its relationated.

     

    I am using visual studio 2005 full version. In my code i am sending a label information to Easy Label I(program to do labels), exactly a print job:

    I added the respective references, but.... the error its going up. In format name especificly.

     

            Dim eObject As ELABELOCXLib.ELabelBatch
            eObject = New ELABELOCXLib.ELabelBatch

            eObject.FormatName = "D:\STJUDE\SERIALLABEL"
            eObject.FormatCount = 1
            eObject.PrinterName = "SATO CX400 IP"
            eObject.PrinterName = "HPPSC1600 on WINDOWS2000" & Trim(strStationIdOut)
            eObject.JobDescription = "Printing ItemSerialNo:"
            eObject.ELShutDown = True
            eObject.HoldFlag = False


            eObject.IgnoreFieldError = True
            eObject.CreateJob(False)

     

            If Not (E Is Nothing) Then
                E = Nothing
            End If

    Wednesday, November 21, 2007 4:02 PM
  • Hello,

     

    Did you figure out what wrong with that code was?

     

    I have the same problem with my OCX. I have implemented my ActiveX component by using VC++ 6.0, and when I try to invoke the related object on my C# (VS 2008) code, what I got in return is this error message.

     

    Please let me know if you have any solution for this problem... (Kinda urgent for me and any help will be deeply appreciated).

     

    Cheers and warm regards,

     

    Ali

     

    Thursday, February 07, 2008 11:14 AM
  • Did you found a solution for this case?
    Tks. R.
    • Proposed as answer by devKH Monday, February 28, 2011 11:23 AM
    • Unproposed as answer by devKH Monday, February 28, 2011 11:24 AM
    Friday, August 22, 2008 10:28 AM
  • I had the same problems, try to using Old fasion "OCX' those were predates .Net

    1, registed those Old fasion OCXs under Windows\system32 and now they become 'COM' object visible to all (WinXP pro environment)

    2, add references into C# application (MS Visual Studio 2008) success, I can see great detail of those OCXs under Object Browser

    3, instantited an new object in C# code success (through Debug)

    4, now the problem is none any methods defined can be invoked, all throws an 'System.Runtime.InteropServices.COMException'

        with 'Catastrophic failure (Exception from HRESULT: 0x8000FFFF (E_UNEXPECTED))'


    I wonder whether there is a special way to handle those 'Old fasion OCX' object under .Net environment ? if I can add references into Dot.Net C# project, why can't use it?


    great appreciated any help and comments

    thx

    Max 

    Friday, April 03, 2009 4:11 PM
  • I am getting the exact same issue as the above post ....

    Does anyone know the answer to this error?
    Thanks,
    A
    Wednesday, May 20, 2009 4:10 PM
  • I had the same problems, try to using Old fasion "OCX' those were predates .Net

    1, registed those Old fasion OCXs under Windows\system32 and now they become 'COM' object visible to all (WinXP pro environment)

    2, add references into C# application (MS Visual Studio 2008) success, I can see great detail of those OCXs under Object Browser

    3, instantited an new object in C# code success (through Debug)

    4, now the problem is none any methods defined can be invoked, all throws an 'System.Runtime.InteropServices.COMException'

        with 'Catastrophic failure (Exception from HRESULT: 0x8000FFFF (E_UNEXPECTED))'


    I wonder whether there is a special way to handle those 'Old fasion OCX' object under .Net environment ? if I can add references into Dot.Net C# project, why can't use it?


    great appreciated any help and comments

    thx

    Max


    I have run into this, as well.  VB handles the dated object without issue, though... C# consistently is generating catastrophic errors.

    Does anyone have anything to contribute?
    Wednesday, July 08, 2009 1:30 AM
  • Have you tried using the AxHost class to wrap the ActiveX control for use in Windows Forms? This appears to be necessary in order to use OCX controls in .NET, and the tool used to generate the wrappers apparently only outputs C# code. (AxImp.exe)

    From Document Explorer:

    ms-help://MS.VSCC.v90/MS.MSDNQTR.v90.en/fxref_system.windows.forms/html/9c712689-c446-fb64-9644-befc6ad3f1cc.htm
    Wednesday, July 08, 2009 8:42 PM
  • this is wha i tried in VB, i have not figure out C# equivalent solution yet.
    You add your activeX control onto the toolbox, then drag it onto the form.

    then view the code of the form1, NOT the codebehind

    put in this 

     Dim objreader As AxCtelssLib.AxCtelss = New AxCtelssLib.AxCtelss() 
    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

    Controls.Add(objreader)  'add control

    End Sub

     Private Sub Command1_Click(ByVal eventSender As System.Object, ByVal eventArgs As System.EventArgs) Handles Command1.Click

    // add your code here

     

    objreader.read()

    End
    Sub

    Wednesday, July 08, 2009 10:05 PM
  • I write a custom MFC Activex and using it with .net (visual studio 2010) I have the same issue:
    'Catastrophic failure (Exception from HRESULT: 0x8000FFFF (E_UNEXPECTED))'

    I resolved the problem in this way:
    - Use vs wizard to add method and event on Activex
    - Import activex from .net with the design-time on form (not directly from code)

    Now when I call my custom activex function all works well..

    Fad
    • Proposed as answer by Levi Domingos Saturday, July 31, 2010 7:57 PM
    Wednesday, December 16, 2009 1:23 PM
  • the solution is

    add to toolbox then added to the form then use as control

    • Proposed as answer by devKH Monday, February 28, 2011 11:33 AM
    Monday, February 28, 2011 11:25 AM
  • I am facing same problem , above none of proposed solutions are not working , i am still getting same error

    PS:- My ActiveX control is build in Delphi and control have menus .. (loading control works fine Delphi test application )

    Please help

    Monday, February 28, 2011 1:53 PM
  • Hi there,

    Since i have the same problem ,Would you explain how to use VS Wizard ? because when i open my VS there is no option to use the wizard ( there's no VS wizard on its menu )

    thanks,

    Ronald

    Thursday, April 21, 2011 9:46 AM
  • I'm having the same issue with an OCX authored in Delphi 3 where I always get the COMExpection - Catastrophic failure (Exception from HRESULT: 0x8000FFFF (E_UNEXPECTED))
    Tuesday, June 14, 2011 12:45 PM