PRB: Using CharSet.None Has the Same Effect as CharSet.Ansi in DllImport (327117)



The information in this article applies to:

  • Microsoft Visual Studio .NET (2002), Professional Edition
  • Microsoft Visual Studio .NET (2002), Enterprise Architect Edition
  • Microsoft Visual Studio .NET (2002), Enterprise Developer Edition
  • Microsoft Visual Studio .NET (2002), Academic Edition

This article was previously published under Q327117

SYMPTOMS

Two different CharSet property values have the same effect, as described in the following:
  • If you declare a function in C# or in C++, the default CharSet property of the DllImport attribute is CharSet.None.
  • If you declare a function in Microsoft Visual Basic .NET, the default CharSet property is CharSet.Ansi.

CAUSE

This behavior occurs because CharSet.None and CharSet.Ansi are equivalent and are designed to have the same effect.

STATUS

This behavior is by design.

Modification Type:MajorLast Reviewed:10/28/2002
Keywords:kbCOMInterop kbprb KB327117 kbAudDeveloper