Solved

0x80040202 error when using Delphi built COM object with C#

Posted on 2003-10-23
4
419 Views
Last Modified: 2010-04-05
Hi,

I'm getting an exception raise when I use a COM object built with Delphi within C#. The exception number is 0x80040202, which occurs when more than one event handler is assigned. There are three events, the first event handler assigned works fine however the afore mentioned exception occurs when the second event handler is assigned.

I've read some stuff from the Microsoft knowledge base regarding a problem with sinker help classes that have the wrong protection type in the Interop type library that .Net generates, but this doesn't seem to be the problem in this case.

Microsoft have taken a look at this problem on our behalf and have not been able to find a solution, they suggested it was a problem with the interface within Delphi and suggested we contacted Borland.

My development teams next step is to be build a series of dummy COM objects under different languages that use the same interface to try and issolate where the problem is.

If anybody out there can sched more light on this it would be greatly appreciated. We don't fancy having to recode all the Delphi stuff in C# just to get round this problem but that's our choice of last resort.

Many thanks,

Richard.

0
Comment
Question by:rikjc
4 Comments
 
LVL 17

Accepted Solution

by:
Wim ten Brink earned 500 total points
ID: 9605534
http://www.google.nl/search?q=0x80040202 - Apparantly you're not the only person with this problem... Have you looked at Google already?
0
 

Author Comment

by:rikjc
ID: 9606161
Yeah I've scoured the net for references to this problem. Most people refer back to the Microsoft knowledge base article which refers to a bug in the ilasm.exe utility that generates the Interop type library for your COM object.

There's quite a few refereces to the same problem in JabberCOM but apparently they got round it by re-coding their COM object in C# as a .Net assembly.
0

Featured Post

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…

707 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now