I get the address of the COM function by loading the type library (TLB) and iterating over the types with ITypeLiband ITypeInfo. After calling the function AddressOfMemberfor ITypeInfo, I came across the following exception:
System.Runtime.InteropServices.COMException (0x800288BD): The module type for the operation is incorrect. (Exception from HRESULT: 0x800288BD (TYPE_E_BADMODULEKIND)) in System.Runtime.InteropServices.ComTypes.ITypeInfo.AddressOfMember (Int32 memid, INVOKEKIND invKind, IntPtr & ppv).
How to get rid of this exception?
Usman source
share