[Mono-bugs] [Bug 517855] Invoking methods via Reflection that have COM objects as parameters throws MissingMethodException in mono.

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Wed Nov 11 15:18:04 EST 2009


User tom_hindle at sil.org added comment

--- Comment #4 from tom hindle <tom_hindle at sil.org>  2009-11-11 13:18:02 MST ---
Ok, attempted to do this in two different ways both seem to work equally well
and pass my tests.

#if true
    if (objArgs != null &&(objArgs[j] is __ComObject))
        IntPtr comInterface;
        Guid g = Marshal.GenerateGuidForType(args [j].ParameterType);
        if (g != Guid.Empty &&
Marshal.QueryInterface(Marshal.GetIUnknownForObject(objArgs[j]), ref g, out
comInterface) == 0 /* S_OK */) 
            continue; // Parameter is implemented by ComObject
    if (objArgs != null && (objArgs[j] is __ComObject))
        IntPtr comInterface = Marshal.GetComInterfaceForObject(objArgs[j], args
        if (comInterface != null)
            continue; // ParameterType is implemented by ComObject

I think I am going to pick the first implementation with QueryInterface as I
guess its quicker.

Attaching patch shortly as soon as rebuilt and retested everything.

Configure bugmail: http://bugzilla.novell.com/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.
You are the assignee for the bug.

More information about the mono-bugs mailing list