Error when saving voice using mciSendString

  • Thread starter Thread starter BigC
  • Start date Start date
B

BigC

I am using the following line of code to save a voice file (.wav) to
disk and it works fine when the filename contains no spaces. However
the file doesn't get saved when its name contains a space. Does anyone
know what is going wrong and how I can fix it ?


nReturn = mciSendString("save Voice1 " & m_sVoiceFile, "0", 0, 0)
 
BigC said:
I am using the following line of code to save a voice file (.wav) to
disk and it works fine when the filename contains no spaces. However
the file doesn't get saved when its name contains a space. Does anyone
know what is going wrong and how I can fix it ?

nReturn = mciSendString("save Voice1 " & m_sVoiceFile, "0", 0, 0)

Untested: Surround the path with double quotation characters
('ControlChars.Quote' or two consecutive double quotes inside a string
literal) or convert it to the old 8.3 path format (this is IMO only possible
using p/invoke calls too).
 
Untested: Surround the path with double quotation characters
('ControlChars.Quote' or two consecutive double quotes inside a string
literal) or convert it to the old 8.3 path format (this is IMO only possible
using p/invoke calls too).

The ControlChars.Quote work a treat, thanks :-)
 
Back
Top