Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
WINMM.DLL and Saving File Names
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00552081
Message ID:
00552433
Views:
16
>>What's the function you're using to save the file? AFAIK, WINMM.DLL's sndPlaySound() function works fine with long file names. So I'm not so sure that's the problem.
>
>I'm using the WINMM.DLL. The actual string is something like this:
>
>mciSendString("save capture "+ThisForm.FileName,"0",0,0)
>
>where ThisForm.FileName is the path returned from PutFile() and could be something like: C:\Program Files\Media\MyTest.wav
>
>When I issue this command it does not save the file. As long as there are no spaces it works as expected. I have tried surround the FileName with chr(34) and everything. I'm going to play with it a little more tonight. If I can't get it to work, then I'm going to try your other suggestion.
>
>Thanks a ton.
>
>DJ :o)

Donald,

After looking at the declaration, I think the problem may be that the call is seeing the spaces as indicating parameters, and doesn't understand them. I've found that, when dealing with API calls, the best thing to do is follow the C declaration as closely as possible. I'd try the following:
DECLARE INTEGER mciSendString IN WINMM.DLL;
  STRING @lpszCommand, STRING @lpszReturnString,;
  INTEGER cchReturn, INTEGER hwndCallback
lcfilename = PUTFILE("Enter a file name", "", "wav")
IF NOT EMPTY(lcfilename)
  IF SPACE(1) $ lcfilename
    lcfilename = CHR(34) + lcfilename + CHR(34)
  ENDIF
  lccmnd - "save capture " + lcfilename
  = mciSendString(@lccmnd, 0, 0, 0)
ENDIF
Note that I'm working from memory on the call, and that lccmnd may not be exactly right. Note also, that passing zero as the second parameter is how a null pointer to a string is made.
George

Ubi caritas et amor, deus ibi est
Previous
Reply
Map
View

Click here to load this message in the networking platform