Long Path Names and 16 Bit 
Author Message
 Long Path Names and 16 Bit

Can anyone tell me how you convert a long file name to a short one?
I'm having problems in a VB.4 app under Win '95 talking to a 16 bit
version of Word.. Word can't find the passed document name because of
the path.

Thanks in Advance.
Paul Murray



Wed, 06 Jan 1999 03:00:00 GMT  
 Long Path Names and 16 Bit

If you are using a VB4-32 bit app under Win95, you can use the
GetShortFileName API to convert the long name to a short one.....

  Dim r&, txt$
  Dim shortPath As String * 256

  file2change$ = "c:\Some Long Path\Some Long FIlename.doc"

  r& = GetShortPathName(fPath$ & file2change$, shortPath$, Len(shortPath$))

  If r& Then
        DOSName = LCase$(Left$(shortPath$, r&))
  Else: DOSName = "<DOS filename can not be determined>"
  End If

If you're using VB4-16, this API is not available; you'll have to
parse the string yourself.



Thu, 07 Jan 1999 03:00:00 GMT  
 Long Path Names and 16 Bit


Quote:
>Can anyone tell me how you convert a long file name to a short one?
>I'm having problems in a VB.4 app under Win '95 talking to a 16 bit
>version of Word.. Word can't find the passed document name because of
>the path.

Try using the GetShortPathName function:

Private Declare Function GetShortPathNameA Lib "kernel32" (ByVal
LongName As String, ByVal ShortName As String, ByVal bufsize As
Integer) As Long

--
VB Info: http://www.sn.no/~balchen/vb/visual.htm
FAQ: http://www.sn.no/~balchen/vb/faq.htm
Knowledge Base: http://www.sn.no/~balchen/vb/kb.htm



Thu, 07 Jan 1999 03:00:00 GMT  
 Long Path Names and 16 Bit

I cannot get the article from VBPJ, but the jist of the solution is to setup
a call to the 32 bit API entrypoint to resolve the name. Perhaps you can
find this on the windx.com site.

Tom



Tue, 09 Feb 1999 03:00:00 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. Changing Long Paths to Short Paths in a 16-bit App

2. copy long files name using 16 bit

3. Long file name Save dialog in VB4 16-bit

4. Long file name Save dialog in VB4 16-bit

5. Long File Name problems in 16-bit VB4 on Win95

6. Long Path Names give Runtime error 76 - Path not found

7. ?: long file in 16 bit (iseFile Control)

8. ? long picture boxes in 16-bit or NT

9. ?: Long PictureBoxes in 16-bit Visual Basic

10. Getting long filenames in 16-bit VB

11. Convert Long Filenames to Short Filenames in VB4 16-Bit

 

 
Powered by phpBB® Forum Software