This category contains 2 posts

Tip for Managed Applications that use COM objects – Exposing Metadata For Your COM Objects Part 1

1. Introduction. 1.1 If you have ever used COM objects in your managed applications, you would have certainly come across an intriguing  type named “System.__ComObject”. 1.2 This type indicates a generic Runtime-Callable Wrapper (RCW) that has no metadata available. It is also an internal class in the mscorlib assembly. It is not possible to define … Continue reading

DynamicMethod as a Viable Alternative to Type.MemberInvoke() and MethodInfo.Invoke()

1. Introduction. 1.1 When using Type.InvokeMember() or MethodInfo.Invoke() to call a method that takes a reference parameter, the referenced object in the arguments array will be updated by the method. However, the arguments array items cannot be used to hold references to existing objects. 1.2 Hence after the method call, the arguments array items will be updated with potentially … Continue reading