Solved

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

Posted on 2003-10-23
4
430 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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
In a recent question (https://www.experts-exchange.com/questions/28997919/Pagination-in-Adobe-Acrobat.html) here at Experts Exchange, a member asked how to add page numbers to a PDF file using Adobe Acrobat XI Pro. This short video Micro Tutorial sh…
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.

825 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