Exemplo n.º 1
0
        // Token: 0x0600000B RID: 11 RVA: 0x000025B0 File Offset: 0x000007B0
        private static object CreateInstance(Guid clsid, string hostName)
        {
            DxpSimpleClass.COSERVERINFO coserverinfo = default(DxpSimpleClass.COSERVERINFO);
            DxpSimpleClass.MULTI_QI[]   array        = new DxpSimpleClass.MULTI_QI[1];
            GCHandle gchandle = GCHandle.Alloc(DxpSimpleClass.IID_IUnknown, GCHandleType.Pinned);

            array[0].iid  = gchandle.AddrOfPinnedObject();
            array[0].pItf = null;
            array[0].hr   = 0u;
            try
            {
                uint clsctx_ALL = DxpSimpleClass.CLSCTX_ALL;
                coserverinfo.pwszName = hostName;
                DxpSimpleClass.CoCreateInstanceEx(ref clsid, null, clsctx_ALL, ref coserverinfo, 1u, array);
            }
            catch (Exception ex)
            {
#if DEBUG
                Debug.WriteLine(ex);
#endif
                return(null);
            }
            gchandle.Free();
            return(array[0].pItf);
        }
Exemplo n.º 2
0
 private static extern void CoCreateInstanceEx(ref Guid clsid, [MarshalAs(UnmanagedType.IUnknown)] object punkOuter, uint dwClsCtx, [In] ref DxpSimpleClass.COSERVERINFO pServerInfo, uint dwCount, [In][Out] DxpSimpleClass.MULTI_QI[] pResults);