Exemple #1
0
 public static String PtrToStringAuto(IntPtr ptr)
 {
     if (Win32Native.NULL == ptr)
     {
         return(null);
     }
     else if (IsWin32Atom(ptr))
     {
         return(null);
     }
     else
     {
         int           nc = Win32Native.lstrlen(ptr);
         StringBuilder sb = new StringBuilder(nc);
         Win32Native.lstrcpy(sb, ptr);
         return(sb.ToString());
     }
 }
Exemple #2
0
 //====================================================================
 // Class constructor.
 //====================================================================
 static Marshal()
 {
     SystemDefaultCharSize = 3 - Win32Native.lstrlen(new sbyte [] { 0x41, 0x41, 0, 0 });
     SystemMaxDBCSCharSize = GetSystemMaxDBCSCharSize();
 }