Why did the exception get the address of the COM function?

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?

+3
source share
1 answer

, , , tlb? , addressofmember DLL, com, , tlb , addressofmember - .

+1

Source: https://habr.com/ru/post/1745236/


All Articles