|
-
May 13th, 2010, 02:23 AM
#1
Why Exception occured getting address of COM function ?
Hello,
I am getting address of COM function by loading type library (TLB) and iterating over types using ITypeLib and ITypeInfo.
After calling AddressOfMember function of ITypeInfo I am facing following exception:
System.Runtime.InteropServices.COMException (0x800288BD): Wrong module kind for the operation. (Exception from HRESULT: 0x800288BD (TYPE_E_BADMODULEKIND)) at System.Runtime.InteropServices.ComTypes.ITypeInfo.AddressOfMember(Int32 memid, INVOKEKIND invKind, IntPtr& ppv).
Any idea how to get rid of this excpetion?
Regards
Usman
-
May 13th, 2010, 03:07 AM
#2
Re: Why Exception occured getting address of COM function ?
Victor Nijegorodov
-
May 13th, 2010, 06:15 AM
#3
Re: Why Exception occured getting address of COM function ?
I've scan my registry..
Registry corrected but problem still remained there. Alots of exceptions still while playing with AddressOfMember()..
Still there..
no change..
Excpetion OccuredSystem.Runtime.InteropServices.COMException (0x800288BD): Wrong module kind for the operation. (Exception from HRESULT: 0x800288BD (TYPE_E_BADMODULEKIND))
at System.Runtime.InteropServices.ComTypes.ITypeInfo.AddressOfMember(Int32 memid, INVOKEKIND invKind, IntPtr& ppv)
:-(
-
May 13th, 2010, 06:28 AM
#4
Re: Why Exception occured getting address of COM function ?
What is the invKind value?
Note that:
Fields and parameters that contain function invocation constants MUST contain a single INVOKEKIND value, and MUST NOT contain bitwise combinations of multiple INVOKEKIND values.
The function invocation constants are defined in the INVOKEKIND enumeration.
Code:
typedef [v1_enum] enum tagINVOKEKIND
{
INVOKE_FUNC = 0x00000001,
INVOKE_PROPERTYGET = 0x00000002,
INVOKE_PROPERTYPUT = 0x00000004,
INVOKE_PROPERTYPUTREF = 0x00000008
} INVOKEKIND;
Victor Nijegorodov
-
May 13th, 2010, 06:46 AM
#5
Re: Why Exception occured getting address of COM function ?
I've provided distinct invoke kind
i.e
System.Runtime.InteropServices.ComTypes.INVOKEKIND.INVOKE_FUNC under case of INVOKEKIND.INVOKE_FUNC.
but still i am facing this exception. strange
Excpetion OccuredSystem.Runtime.InteropServices.COMException (0x800288BD): Wrong module kind for the operation. (Exception from HRESULT: 0x800288BD (TYPE_E_BADMODULEKIND))
at System.Runtime.InteropServices.ComTypes.ITypeInfo.AddressOfMember(Int32 memid, INVOKEKIND invKind, IntPtr& ppv)
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|