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


C# ITypeInfo.GetVarDesc方法代码示例

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


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

示例1: GetVarDesc

 public IntPtr GetVarDesc(ITypeInfo typeInfo, int index)
 {
     if (typeInfo == null) throw new ArgumentNullException(nameof(typeInfo));
     IntPtr ret;
     typeInfo.GetVarDesc(index, out ret);
     return ret;
 }
开发者ID:dbremner,项目名称:clrinterop,代码行数:7,代码来源:DefaultDaemon.cs

示例2: GetVarDescForVarIndex

        /// <summary>
        /// Helper method for retrieving type attributes for a given type info
        /// This method needs to also return the native pointer to be released when we're done with our VARDESC.
        /// It's not really possible to copy everything to a managed struct and then release the ptr immediately
        /// here, since VARDESCs contain other native pointers we may need to access.
        /// </summary>
        /// <param name="typeInfo"></param>
        /// <param name="varIndex"></param>
        /// <param name="typeAttr"></param>
        /// <param name="varDesc"></param>
        /// <param name="varDescHandle"></param>
        /// <returns></returns>
        internal static void GetVarDescForVarIndex(ITypeInfo typeInfo, int varIndex, out VARDESC varDesc, out IntPtr varDescHandle)
        {
            IntPtr pVarDesc = IntPtr.Zero;
            typeInfo.GetVarDesc(varIndex, out pVarDesc);

            // GetVarDesc should never return null, this is just to be safe
            if (pVarDesc == IntPtr.Zero)
            {
                throw new COMException(
                    ResourceUtilities.FormatResourceString("ResolveComReference.CannotRetrieveTypeInformation"));
            }

            varDesc = (VARDESC)Marshal.PtrToStructure(pVarDesc, typeof(VARDESC));
            varDescHandle = pVarDesc;
        }
开发者ID:cameron314,项目名称:msbuild,代码行数:27,代码来源:ComReference.cs

示例3: GetVarDescForVarIndex

 internal static void GetVarDescForVarIndex(ITypeInfo typeInfo, int varIndex, out System.Runtime.InteropServices.ComTypes.VARDESC varDesc, out IntPtr varDescHandle)
 {
     IntPtr zero = IntPtr.Zero;
     typeInfo.GetVarDesc(varIndex, out zero);
     if (zero == IntPtr.Zero)
     {
         throw new COMException(Microsoft.Build.Shared.ResourceUtilities.FormatResourceString("ResolveComReference.CannotRetrieveTypeInformation", new object[0]));
     }
     varDesc = (System.Runtime.InteropServices.ComTypes.VARDESC) Marshal.PtrToStructure(zero, typeof(System.Runtime.InteropServices.ComTypes.VARDESC));
     varDescHandle = zero;
 }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:11,代码来源:ComReference.cs

示例4: GetVarDesc_Proxy

 private static IntPtr GetVarDesc_Proxy(ITypeInfo typeInfo, int index)
 {
     IntPtr varDesc;
     typeInfo.GetVarDesc(index, out varDesc);
     return varDesc;
 }
开发者ID:dbremner,项目名称:clrinterop,代码行数:6,代码来源:FormDaemon.cs


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