API之怪现象,高分,在线!!!!
Dim Buffer As String, Ret As Long
'create a buffer
Buffer = Space(255)
'copy the current directory to the buffer and append 'myfile.ext'
Ret = GetFullPathName("sale.bak", 255, Buffer, "")
'remove the unnecessary chr$(0)'s
Buffer = Left(Buffer, Ret)
'show the result
MsgBox Buffer
API定义:
Public Declare Function GetFullPathName Lib "kernel32" Alias "GetFullPathNameA" (ByVal lpFileName As String, ByVal nBufferLength As Long, ByVal lpBuffer As String, ByVal lpFilePart As String) As Long
出现提示框:c:\program files\microsoft visual studio\vb98\sale.bak
问题:不管sale.bak在哪个盘,但提示框的信息恒定不变,事实上sale.bak根本不在提示框显示的路径