Wrox Programmer Forums
Go Back   Wrox Programmer Forums > C# and C > C# 1.0 > C#
|
C# Programming questions specific to the Microsoft C# language. See also the forum Beginning Visual C# to discuss that specific Wrox book and code.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the C# section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old August 14th, 2003, 08:49 AM
Authorized User
 
Join Date: Aug 2003
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
Default COMException Catastrophic Failure

Hi,

I've created a simple C++ MFC Active control in Vis Studio.NET.
I've also created a simple C# application that references the OCX.

/***************************
TestLib.TestClass ts = new TestLib.TestClass();

try
{
  ts.Test();
}
catch(Exception Ex)
{
   System.Windows.Forms.MessageBox.Show(Ex.Message, Ex.GetType().ToString());
}
***************************/


I can instantiate the OCX no problem but when I call a function
in the OCX I get the exception

'System.Runtime.InteropServices.COMException' occurred in mscorlib.dll
Additional information: Catastrophic failure

The ActiveX control has absolutely no additional code other than
that created by VS.NET.

Thanks,

James.

 
Old March 30th, 2004, 05:35 AM
Registered User
 
Join Date: Mar 2004
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Have you already found a solution for this problem? If you have, please send me the solution!
[email protected]

Thanks.

Quote:
quote:Originally posted by jdmc
 Hi,

I've created a simple C++ MFC Active control in Vis Studio.NET.
I've also created a simple C# application that references the OCX.

/***************************
TestLib.TestClass ts = new TestLib.TestClass();

try
{
ts.Test();
}
catch(Exception Ex)
{
System.Windows.Forms.MessageBox.Show(Ex.Mess age, Ex.GetType().ToString());
}
***************************/


I can instantiate the OCX no problem but when I call a function
in the OCX I get the exception

'System.Runtime.InteropServices.COMException' occurred in mscorlib.dll
Additional information: Catastrophic failure

The ActiveX control has absolutely no additional code other than
that created by VS.NET.

Thanks,

James.

 
Old March 31st, 2004, 05:18 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 453
Thanks: 0
Thanked 1 Time in 1 Post
Send a message via AIM to Ankur_Verma Send a message via MSN to Ankur_Verma
Default

I would suggest you to create a Runtime Callable Wrapper yourself if you were creating a simple COM component. But it is an ActiveX control you are creating so all you have to do is Add the control to your Toolbox using Add/Remove Items... , drop the control on you form and then use the control variable to call the methods.

Ankur Verma
.Net and C++ Specialist
Wiley Tech Support
 
Old November 17th, 2006, 03:16 AM
Registered User
 
Join Date: Nov 2006
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Add the following function in ur MFC Active control class, since u r not using a window to host ur activex

BOOL IsInvokeAllowed(DISPID dispid);

BOOL CYourActvxCtrl::IsInvokeAllowed(DISPID dispid)
{
        return TRUE;
}

Note: I checked in VC 6. wil be the same in ur case.
 
Old December 16th, 2009, 10:30 AM
Fad Fad is offline
Registered User
 
Join Date: Dec 2009
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default ActiveX

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..





Similar Threads
Thread Thread Starter Forum Replies Last Post
activex catastrophic failure cobweb ASP.NET 2.0 Basics 0 July 18th, 2006 03:46 AM
System.Runtime.InteropServices.COMException (0x800 mithunak C# 0 February 16th, 2006 02:56 AM
System.RunTime.InteropServices.ComException mohitbhutani C# 0 October 17th, 2005 02:57 AM
Automation error -- Catastrophic faiure rahzan Access VBA 0 July 17th, 2005 11:25 PM
Catastrophic failure cyberbhaskar Classic ASP Databases 0 September 16th, 2003 12:19 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.