此版本不支持属性“System.Runtime.InteropServices.DefaultCharSetAttribute”

更新:2007 年 11 月

System.Runtime.InteropServices.DefaultCharSetAttribute 属性可用于指定要在封送的字符串中使用的字符集。它的值采用 System.Runtime.InteropServices.CharSet 枚举的成员。

Visual Basic 的当前版本不支持此属性。在将来的版本中可能会支持它。

**错误 ID:**BC32510

更正此错误

  • 使用各 Declare 语句 来指定它声明的外部过程的字符集。下面的示例阐释这一点。

    Ansi Declare Function GetUserName Lib "advapi32.dll" _
        (ByVal lpBuffer As String, ByRef nSize As Integer) As Integer
    Unicode Declare Sub externalProc Lib "projectlib.dll" _
        (ByVal arg As Double)
    

    如果您没有在 Declare 语句中指定字符集,则它默认为 ANSI。

请参见

参考

DefaultCharSetAttribute

CharSet

Declare 语句

其他资源

Visual Basic 中的属性 (Attribute)