当前位置: 首页>>代码示例>>C#>>正文


C# IMoniker.BindToObject方法代码示例

本文整理汇总了C#中IMoniker.BindToObject方法的典型用法代码示例。如果您正苦于以下问题:C# IMoniker.BindToObject方法的具体用法?C# IMoniker.BindToObject怎么用?C# IMoniker.BindToObject使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在IMoniker的用法示例。


在下文中一共展示了IMoniker.BindToObject方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: CreateCaptureDevice

 /// <summary>
 /// Luoz: 创建用户选择的设备设备
 /// </summary>
 bool CreateCaptureDevice(IMoniker mon)
 {
     object capObj = null;
     try
     {
         Guid gbf = typeof(IBaseFilter).GUID;
         mon.BindToObject(null, null, ref gbf, out capObj);
         capFilter = (IBaseFilter)capObj; capObj = null;
         return true;
     }
     catch (Exception ee)
     {
         MessageBox.Show(this, "Could not create capture device\r\n" + ee.Message, "DirectShow.NET", MessageBoxButtons.OK, MessageBoxIcon.Stop);
         return false;
     }
     finally
     {
         if (capObj != null)
             Marshal.ReleaseComObject(capObj); capObj = null;
     }
 }
开发者ID:yuanjunsc,项目名称:Telepresence-Robo,代码行数:24,代码来源:Form1.cs

示例2: DisplayPropertyPage_Device

        /// <summary>
        /// Displays property page for device.
        /// </summary>
        /// <param name="moniker">Moniker (device identification) of camera.</param>
        /// <param name="hwndOwner">The window handler for to make it parent of property page.</param>
        /// <seealso cref="Moniker"/>
        public static void DisplayPropertyPage_Device(IMoniker moniker, IntPtr hwndOwner)
        {
            if (moniker == null)
                return;

            object source = null;
            Guid iid = typeof(IBaseFilter).GUID;
            moniker.BindToObject(null, null, ref iid, out source);
            IBaseFilter theDevice = (IBaseFilter)source;

            DisplayPropertyPageFilter(theDevice, hwndOwner);

            //Release COM objects
            SafeReleaseComObject(theDevice);
            theDevice = null;
        }
开发者ID:robotsrulz,项目名称:Sardauscan,代码行数:22,代码来源:Camera.cs

示例3: CreateCaptureDevice

        /// <summary> create the user selected capture device. </summary>
        bool CreateCaptureDevice(IMoniker mon)
        {
            int hr;
            object capObj = null;
            try
            {
                Guid gbf = typeof(IBaseFilter).GUID;
                Guid classID;

                mon.BindToObject(null, null, ref gbf, out capObj);
                capFilter = (IBaseFilter)capObj;

                IPin[] pin = new IPin[2];
                int count;
                PinDirection pinDir;
                IEnumPins enumPins;
                if (capFilter.EnumPins(out enumPins) == 0)
                {
                    if (((hr = enumPins.Next(1, pin, out count)) == 0))
                    {
                        pin[0].QueryDirection(out pinDir);
                        if (pinDir == PinDirection.Output)
                            captureDevOutPin = pin[0];
                        if (count > 1)
                            Marshal.ReleaseComObject(pin[1]);
                    }
                    Marshal.ReleaseComObject(enumPins);
                }
                if (captureDevOutPin == null)
                    throw new Exception("Cannot find output pin for capture device");
                return true;
            }
            catch (Exception ee)
            {
                LogInfo(LogGroups.Console, "Could not create capture device\r\n" + ee.Message);
                return false;
            }
            //finally
            //{
            //    if (capObj != null)
            //    {
            //        Marshal.ReleaseComObject(capObj);
            //        capObj = null;
            //    }
            //}
        }
开发者ID:ctapang,项目名称:GPUCyclops,代码行数:47,代码来源:DShowMFVGraph.cs


注:本文中的IMoniker.BindToObject方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。