I'm trying to get a short path name using the api call. This is a Win2k machine, either Datacenter or Advanced Server, is there a different API i could use?
It's in a module, then i just callCode:Private Declare Function GetShortPathName Lib "kernel32" Alias _ "GetShortPathNameA" (ByVal lpszLongPath As String, ByVal _ lpszShortPath As String, ByVal lBuffer As Long) As Long Public Function GetShortPath(strFileName As String) As String Dim lngRes As Long Dim strPath As String strPath = String$(165, 0) lngRes = GetShortPathName(strFileName, strPath, 164) GetShortPath = Left$(strPath, lngRes) End Function
MsgBox GetShortPath("C:\Program Files\TPlatC\")
When i step through the program the api call just doesn't return anything. Can anyone help?




Reply With Quote