我们知道Win API 的阵列传递是传阵列的起始位址,所以了,在VB中唯一要注意的 是起始位置的写法。以另一个取得Window目录所在路径的API为 例: ----------------------------------------------------------------------------- UINT GetWindowsDirectory( LPTSTR lpBuffer, // address of buffer for Windows directory UINT uSize // size of directory buffer ); // 若成功,则传回目录的字元数 VB的宣告(API检视员) Declare Function GetWindowsDirectory Lib "kernel32" Alias _ "GetWindowsDirectoryA" (ByVal lpBuffer As String, ByVal nSize As Long) _ As Long 我们将之更改为 Declare Function GetWindowsDirectory Lib "kernel32" Alias _ "GetWindowsDirectoryA" ( lpBuffer As Byte, ByVal nSize As Long) As Long