BorlandTalk.com Forum Index BorlandTalk.com
Borland discussion newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Event problem towards .NET

 
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> C++ Builder (ActiveX)
View previous topic :: View next topic  
Author Message
A Jarold
Guest





PostPosted: Tue May 08, 2007 8:10 am    Post subject: Event problem towards .NET Reply with quote



I have a com object with several events that works fine when used for
instance with VB6 or C++. However when trying to use it from a .NET code it
crashes if I add more than 5 event handlers, when creating the object. Note
that it doesn't matter what event handlers, just that there are more than
five handlers and it doesn't work.
The com object was written in BDS2006 environment using C++Builder.

/ Anders

Error message when used from VB.NET.
System.Runtime.InteropServices.COMException was unhandled

ErrorCode=-2147220991

Message="An event was unable to invoke any of the subscribers (Exception
from HRESULT: 0x80040201)"

Source="mscorlib"

StackTrace:

at
System.Runtime.InteropServices.ComTypes.IConnectionPoint.Advise(Object
pUnkSink, Int32& pdwCookie)

at
BPTITest.ICoBpTiEvents_EventProvider.add_cardDataEvent(ICoBpTiEvents_cardDataEventEventHandler
)

at
BPTITest.ICoBpTiEvents_Event.add_cardDataEvent(ICoBpTiEvents_cardDataEventEventHandler
)

at BPTI_test.frmMain.set_api(CoBpTi WithEventsValue)

at BPTI_test.frmMain.frmMain_Load(Object sender, EventArgs e) in
C:\Documents and Settings\Remuz\My Documents\Visual Studio
2005\Projects\BPTI-test\BPTI-test\frmMain.vb:line 38
Back to top
A Jarold
Guest





PostPosted: Tue May 15, 2007 3:59 pm    Post subject: Re: Event problem towards .NET Reply with quote



Has been solved by looking at http://support.microsoft.com/kb/810228/en-us

Me and others were fooled by VS which showed all the eventd even when threre
was no sink object for it.

A Jarold


"A Jarold" <barf> skrev i meddelandet
news:46402767$1 (AT) newsgroups (DOT) borland.com...
Quote:
I have a com object with several events that works fine when used for
instance with VB6 or C++. However when trying to use it from a .NET code it
crashes if I add more than 5 event handlers, when creating the object. Note
that it doesn't matter what event handlers, just that there are more than
five handlers and it doesn't work.
The com object was written in BDS2006 environment using C++Builder.

/ Anders

Error message when used from VB.NET.
System.Runtime.InteropServices.COMException was unhandled

ErrorCode=-2147220991

Message="An event was unable to invoke any of the subscribers (Exception
from HRESULT: 0x80040201)"

Source="mscorlib"

StackTrace:

at
System.Runtime.InteropServices.ComTypes.IConnectionPoint.Advise(Object
pUnkSink, Int32& pdwCookie)

at
BPTITest.ICoBpTiEvents_EventProvider.add_cardDataEvent(ICoBpTiEvents_cardDataEventEventHandler
)

at
BPTITest.ICoBpTiEvents_Event.add_cardDataEvent(ICoBpTiEvents_cardDataEventEventHandler
)

at BPTI_test.frmMain.set_api(CoBpTi WithEventsValue)

at BPTI_test.frmMain.frmMain_Load(Object sender, EventArgs e) in
C:\Documents and Settings\Remuz\My Documents\Visual Studio
2005\Projects\BPTI-test\BPTI-test\frmMain.vb:line 38

Back to top
Display posts from previous:   
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> C++ Builder (ActiveX) All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.