本文整理汇总了C#中System.Runtime.InteropServices.ComTypes.GetFuncDesc方法的典型用法代码示例。如果您正苦于以下问题:C# ComTypes.GetFuncDesc方法的具体用法?C# ComTypes.GetFuncDesc怎么用?C# ComTypes.GetFuncDesc使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Runtime.InteropServices.ComTypes
的用法示例。
在下文中一共展示了ComTypes.GetFuncDesc方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GetMethodInformationArray
/// <summary>
/// Converts a MethodBase[] into a MethodInformation[]
/// </summary>
/// <returns>the ComMethodInformation[] corresponding to methods</returns>
internal static ComMethodInformation[] GetMethodInformationArray(COM.ITypeInfo typeInfo, Collection<int> methods, bool skipLastParameters)
{
int methodCount = methods.Count;
int count = 0;
ComMethodInformation[] returnValue = new ComMethodInformation[methodCount];
foreach (int index in methods)
{
IntPtr pFuncDesc;
typeInfo.GetFuncDesc(index, out pFuncDesc);
COM.FUNCDESC funcdesc = ClrFacade.PtrToStructure<COM.FUNCDESC>(pFuncDesc);
returnValue[count++] = ComUtil.GetMethodInformation(funcdesc, skipLastParameters);
typeInfo.ReleaseFuncDesc(pFuncDesc);
}
return returnValue;
}
示例2: GetFuncDescForDescIndex
private static void GetFuncDescForDescIndex(ComTypes.ITypeInfo typeInfo, int funcIndex, out ComTypes.FUNCDESC funcDesc, out IntPtr funcDescHandle) {
IntPtr pFuncDesc = IntPtr.Zero;
typeInfo.GetFuncDesc(funcIndex, out pFuncDesc);
// GetFuncDesc should never return null, this is just to be safe
if (pFuncDesc == IntPtr.Zero) {
throw Error.CannotRetrieveTypeInformation();
}
funcDesc = (ComTypes.FUNCDESC)Marshal.PtrToStructure(pFuncDesc, typeof(ComTypes.FUNCDESC));
funcDescHandle = pFuncDesc;
}
示例3: GetFuncDesc
internal static COM.FUNCDESC GetFuncDesc(COM.ITypeInfo typeinfo, int index)
{
IntPtr pFuncDesc;
typeinfo.GetFuncDesc(index, out pFuncDesc);
COM.FUNCDESC funcdesc = ClrFacade.PtrToStructure<COM.FUNCDESC>(pFuncDesc);
typeinfo.ReleaseFuncDesc(pFuncDesc);
return funcdesc;
}