The Labs \ Source Viewer \ SSCLI \ System.Runtime.InteropServices \ CharSet

  1. // ==++==
  2. //
  3. //
  4. // Copyright (c) 2006 Microsoft Corporation. All rights reserved.
  5. //
  6. // The use and distribution terms for this software are contained in the file
  7. // named license.txt, which can be found in the root of this distribution.
  8. // By using this software in any fashion, you are agreeing to be bound by the
  9. // terms of this license.
  10. //
  11. // You must not remove this notice, or any other, from this software.
  12. //
  13. //
  14. // ==--==
  15. ////////////////////////////////////////////////////////////////////////////////
  16. ////////////////////////////////////////////////////////////////////////////////
  17. namespace System.Runtime.InteropServices
  18. {
  19.     using System;
  20.     // Use this in P/Direct function prototypes to specify
  21.     // which character set to use when marshalling Strings.
  22.     // Using Ansi will marshal the strings as 1 byte char*'s.
  23.     // Using Unicode will marshal the strings as 2 byte wchar*'s.
  24.     // Generally you probably want to use Auto, which does the
  25.     // right thing 99% of the time.
  26.     [Serializable()]
  27.     [System.Runtime.InteropServices.ComVisible(true)]
  28.     public enum CharSet
  29.     {
  30.         None = 1,
  31.         // User didn't specify how to marshal strings.
  32.         Ansi = 2,
  33.         // Strings should be marshalled as ANSI 1 byte chars.
  34.         Unicode = 3,
  35.         // Strings should be marshalled as Unicode 2 byte chars.
  36.         Auto = 4
  37.         // Marshal Strings in the right way for the target system.
  38.     }
  39. }

Developer Fusion