mciSendString: file that contains spaces
If i use mciSendString (winmm.dll) and try to read file that conta开发者_如何学运维ins spaces (for example F:\MUSIC\(01) [VA]01.StimAxel - Restart(DJ X-VenomRemix).mp3) i got an error with code 263.
mciSendString can't work with files that contains spaces. How to avoid this problem?
Pcommand = "status \"" + path + "\" length";
int ret = (int)mciSendString(Pcommand, sBuffer, sBuffer.Capacity, 0);
Try surrounding the filename with double quotes.
Update: According to the docs, the status
command takes a device name, not a filename. You need to use open
to open the file on a specific device, then pass that device name to status
.
精彩评论