Event Handling IDispatch::Invoke() Implementation of the CLR.


hello all,

1. have made report microsoft connect regarding possible bug in clr code handles com events fired unmanaged com servers :

microsoft connect

2. since then, have been doing research on internals of flow of event firing unmanaged com server's idispatch::invoke() method call right down invokation of managed object's event handler delegate function.


3. have managed find interesting information comeventssink class :

comeventssink.cs

4. class provides implementation idispatch , used comeventshelper , comeventsinfo classes. invoke() method provided info me , there hint on why event method takes a  safearray reference parameter winds returning e_invalidarg (an argumentexception exception thrown).

5. had @ *_sinkhelper class declared in disassembled il code of interop assembly generated tlbimp.exe unmanaged com server. see directly calls invoke() method of delegate no reference comeventssink object.

6. pretty clear there must idispatch implementation behind sinkhelper class gets called com server event firing code.

7. since sinkhelper class derived system.object, believe sinkhelper inherits idispatch implementation of system.object class.

9.it possible system.object may internally use comeventssink class handle com events.

10. wondering if has knowledge of idispatch implementation ?

11. thanks, all.


- bio.



please visit blog : http://limbioliong.wordpress.com/


hi bio,

>>"i wondering if has knowledge of idispatch implementation ? "

i can't find implement on microsoft reference source site. in com, invoke method internally uses getidsofnames. think .net same. there thread on stack overflow show how use idispatch interface in c#.

calling member of idispatch com interface c#

best regards,
li wang


we trying better understand customer views on social support experience, participation in interview project appreciated if have time. helping make community forums great place.
click here participate survey.



.NET Framework  >  Common Language Runtime Internals and Architecture



Comments

Popular posts from this blog

Azure DocumentDB Owner resource does not exist

job syspolicy_purge_history job fail in sqlserver 2008

Trying to register with public marketplace error with 'Get-AzureStackStampInformation'