|
code
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
How do I deploy a VB6 program to folder whose filename has spaces?I have written a program in Visual Basic 6 which plays AVI files using
the API function winmm.dll. I want to deploy this program to other PC's. However, because of a limitation in winmm.dll, the AVI files will not play when the program is installed to a directory whose filename contains space(s), e.g. "Program Files", the default folder for program installation. There is another API function which corrects this, but for the life of me, I can't remember whixh one it is. Do any of know the name of this DLL file? Den "Denny D" <calliope***@hotmail.com> wrote in message The "key" is to wrap filenames in double-quotes.news:8uip91965s0i94dipf65qotsa4bols9act@4ax.com... >I have written a program in Visual Basic 6 which plays AVI files using > the API function winmm.dll. I want to deploy this program to other > PC's. However, because of a limitation in winmm.dll, the AVI files > will not play when the program is installed to a directory whose > filename contains space(s), e.g. "Program Files", the default folder > for program installation. There is another API function which > corrects this, but for the life of me, I can't remember whixh one it > is. Do any of know the name of this DLL file? > > Den -- Ken Halter - MS-MVP-VB - http://www.vbsight.com DLL Hell problems? Try ComGuard - http://www.vbsight.com/ComGuard.htm Sign up now to help keep VB support alive - http://classicvb.org/petition Please keep all discussions in the groups..
Show quote
Hide quote
"Ken Halter" <Ken_Halter@Use_Sparingly_Hotmail.com> wrote in message Ken (and Denny, et.al.), even that's problematic because MCI has limits on news:On4t7miZFHA.796@TK2MSFTNGP10.phx.gbl... > "Denny D" <calliope***@hotmail.com> wrote in message > news:8uip91965s0i94dipf65qotsa4bols9act@4ax.com... >>I have written a program in Visual Basic 6 which plays AVI files using >> the API function winmm.dll. I want to deploy this program to other >> PC's. However, because of a limitation in winmm.dll, the AVI files >> will not play when the program is installed to a directory whose >> filename contains space(s), e.g. "Program Files", the default folder >> for program installation. There is another API function which >> corrects this, but for the life of me, I can't remember whixh one it >> is. Do any of know the name of this DLL file? >> >> Den > > The "key" is to wrap filenames in double-quotes. the length of command strings (I believe it's 128 characters for the *entire* command string). A long path and filename can easily cause that limit to be exceeded. Therefore, it's best to always get the short path and filename and use that with MCI. -- Mike Microsoft MVP Visual Basic > I have written a program in Visual Basic 6 which plays AVI files using Try this:> the API function winmm.dll. I want to deploy this program to other > PC's. However, because of a limitation in winmm.dll, the AVI files > will not play when the program is installed to a directory whose > filename contains space(s), e.g. "Program Files", the default folder > for program installation. There is another API function which > corrects this, but for the life of me, I can't remember whixh one it > is. Do any of know the name of this DLL file? '*** Private Declare Function GetShortPathName Lib "Kernel32.dll" Alias "GetShortPathNameA" ( _ ByVal lpszLongPath As String, ByVal lpszShortPath As String, ByVal lBuffer As Long) As Long Private Function MakeShortPath(ByRef inPath As String) As String Dim BufLen As Long, StrBuf As String BufLen = GetShortPathName(inPath, vbNullString, 0) If (BufLen) Then StrBuf = Space$(BufLen) MakeShortPath = Left$(StrBuf, GetShortPathName(inPath, StrBuf, BufLen)) End If End Function '*** Hope this helps, Mike - Microsoft Visual Basic MVP - E-Mail: ED***@mvps.org WWW: Http://EDais.mvps.org/ You're using the mciSendString function? MciSendString does fart on
path/file names containing spaces. I'm guessing you're thinking of the GetShortPathName function of kernel32. Show quoteHide quote "Denny D" <calliope***@hotmail.com> wrote in message news:8uip91965s0i94dipf65qotsa4bols9act@4ax.com... > I have written a program in Visual Basic 6 which plays AVI files using > the API function winmm.dll. I want to deploy this program to other > PC's. However, because of a limitation in winmm.dll, the AVI files > will not play when the program is installed to a directory whose > filename contains space(s), e.g. "Program Files", the default folder > for program installation. There is another API function which > corrects this, but for the life of me, I can't remember whixh one it > is. Do any of know the name of this DLL file? > > Den |
|||||||||||||||||||||||