|
-
Jul 4th, 2001, 02:51 PM
#1
Thread Starter
Addicted Member
Opening a file!
Is it possible to open a file with spaces in it's name with the f***ing shell method without having to convert the name into his (MS-DOS) short spelling??
-
Jul 4th, 2001, 02:59 PM
#2
Fanatic Member
It should allow for that. I tried doing that in VB5 and it worked. Are you sure you have the right long file name?
It's not hard to convert it. Just use this, and you don't have to worry at all. If this short path doesn't work, the file isn't there .
VB Code:
Public Declare Function GetShortPathName Lib "kernel32" Alias "GetShortPathNameA" (ByVal strLongPath As String, ByVal strShortPath As String, ByVal lngBufferLength As Long) As Long
Public Function ShortPath(ByVal strLongPath As String) As String
Dim strBuffer As String * 256
Dim lngLength As Long
lngLength = GetShortPathName(strLongPath, strBuffer, Len(strBuffer))
ShortPath = Left$(strBuffer, lngLength)
End Function
Last edited by Kaverin; Jul 4th, 2001 at 03:03 PM.
I'm baaaack...
VB5 Professional Edition, VC++ 6
Using a 1 gHz Thunderbird, 256 mb RAM, 40 gb HD system with Win98se
I feel special because I finally figured out how to loop midis: Post link
I'm a fanatic too 
-
Jul 4th, 2001, 03:08 PM
#3
Thread Starter
Addicted Member
Thanks!
It worked well!
This function saves me a lot of time!
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|