Multiple Event Handling Exception with COM Components

S

sankar.vikram

Hi

I am using a com component in my C# application.
But i getting error while i tried to call multiple events from my
application.
I'm getting the error "Exception from HRESULT: 0x80040202"

It would be appreciated if anyone come with the solution.

Sankar
 
N

Nicholas Paldino [.NET/C# MVP]

Sankar,

You need to do a little better than that. A full code sample, as well
as WHICH COM component you are using, and what events you are firing would
help greatly.

i
 
S

sankar.vikram

Hi Nicholas

I am using a delphi com component in C# my application.
when i call the following event its working fine
PInterface.NTransactionAvailable += new
IPOSInterfaceEvents_NTransactionAvailableEventHandler(PInterface_NTransactionAvailable);

But i tried to add one more event handler like the following code, its
showing the error "Exception from HRESULT: 0x80040202"

PInterface.NTransactionReturned += new
IPOSInterfaceEvents_NTransactionReturnedEventHandler(PInterface_NTransactionReturned);

If i comment the 1st event handler, the second will work. I need to
add more than 10 event handler

Hope this will give you an idea about my problem.

Thanks
sankar
 
K

KWienhold

Hi Nicholas

I am using a delphi com component in C# my application.
when i call the following event its working fine
PInterface.NTransactionAvailable += new
IPOSInterfaceEvents_NTransactionAvailableEventHandler(PInterface_NTransacti-onAvailable);

But i tried to add one more event handler like the following code, its
showing the error "Exception from HRESULT: 0x80040202"

PInterface.NTransactionReturned += new
IPOSInterfaceEvents_NTransactionReturnedEventHandler(PInterface_NTransactio-nReturned);

If i comment the 1st event handler, the second will work. I need to
add more than 10 event handler

Hope this will give you an idea about my problem.

Thanks
sankar






- Zitierten Text anzeigen -

A quick google-search shows that quite a few people have similar
problems. It seems to be related to a bug that causes event sinks to
be declared as private in the wrapper.
Just google for "HRESULT 0x80040202" and you should be able to find a
solution to your problem.

Kevin Wienhold
 
S

sankar.vikram

A quick google-search shows that quite a few people have similar
problems. It seems to be related to a bug that causes event sinks to
be declared as private in the wrapper.
Just google for "HRESULT 0x80040202" and you should be able to find a
solution to your problem.

Kevin Wienhold- Hide quoted text -

- Show quoted text -

Hi Kevin

I did the same thing,ie changed two private events sinks to public in
the wrapper class. But still showing the same error, do you have any
other solutions to solve this.

Thanks

Sankar
 
S

Serge Baltic

Hello,
I did the same thing,ie changed two private events sinks to public in
the wrapper class. But still showing the same error, do you have any
other solutions to solve this.

Use a multiplexor for adding multiple handlers — that is, sink the event
only once, and dispatch the event from that handler method to whatever number
of handlers you actually need.

(H) Serge
 
S

sankar.vikram

Hi Serge

Can u tell me, how to use the multiplexor in C#, or can u tell me any
reference for doing the same.

Thanks
Sankar
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top