.NET Compact COM interoperability

Posted by markhor on Stack Overflow See other posts from Stack Overflow or by markhor
Published on 2010-03-15T09:04:10Z Indexed on 2010/03/15 9:09 UTC
Read the original article Hit count: 309

Filed under:
|
|
|

I have the following code in a full .NET framework solution:


public delegate int CreateObjectDelegate(
            [In] ref Guid classID,
            [In] ref Guid interfaceID,
            [MarshalAs(UnmanagedType.Interface)] out object outObject);

...

var createObject = (NativeMethods.CreateObjectDelegate)
    Marshal.GetDelegateForFunctionPointer(
        NativeMethods.GetProcAddress(_modulePtr, "CreateObject"),
            typeof (NativeMethods.CreateObjectDelegate));
object result;
Guid interfaceId = _guid;
Guid classID = _classId;
createObject(ref classID, ref interfaceId, out result);

The purpose is to create the needed COM object at runtime. Is it possible with any .NET compact framework?

Note that it doesn't have Marshal.GetDelegateForFunctionPointer.

© Stack Overflow or respective owner

Related posts about c#

Related posts about .NET