本文整理汇总了C#中System.IntPtr.PtrToString方法的典型用法代码示例。如果您正苦于以下问题:C# IntPtr.PtrToString方法的具体用法?C# IntPtr.PtrToString怎么用?C# IntPtr.PtrToString使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.IntPtr
的用法示例。
在下文中一共展示了IntPtr.PtrToString方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: FromIntPtr
public void FromIntPtr(IntPtr ptr)
{
Value = ptr.PtrToString ();
}
示例2: CompareCallback
/// <summary>
/// Internal collation sequence function, which wraps up the raw string pointers and executes the Compare() virtual function.
/// </summary>
/// <param name="len1">Length of the string pv1</param>
/// <param name="ptr1">Pointer to the first string to compare</param>
/// <param name="len2">Length of the string pv2</param>
/// <param name="ptr2">Pointer to the second string to compare</param>
/// <returns>Returns -1 if the first string is less than the second. 0 if they are equal, or 1 if the first string is greater
/// than the second.</returns>
internal int CompareCallback(int len1, IntPtr ptr1, int len2, IntPtr ptr2)
{
return Compare(ptr1.PtrToString (), ptr2.PtrToString ());
}