I've only ever done this like: pcmd: string;
pcmd:='open "'+filename+'" ... '+#0; mciSendString(@pcmd[1], ...); mciSendString does return errors.. duno if that'll be helpful. I originally used it in Virtual Pascal and had to make a partial header myself so the FreePascal one might take parameters differently. ________________________________ From: fpc-pascal <fpc-pascal-boun...@lists.freepascal.org> on behalf of James Richters via fpc-pascal <fpc-pascal@lists.freepascal.org> Sent: Tuesday, September 20, 2022 9:56:03 AM To: 'FPC-Pascal users discussions' <fpc-pascal@lists.freepascal.org> Cc: James Richters <james.richt...@productionautomation.net> Subject: [fpc-pascal] mciSendString with long file names I’m trying to get mciSendString() to work with long file names with spaces in them and I’m not having any success. I know with winnows you need quotes around long file names, so I’m trying things like this: Var MySoundFile:String; mciSendString(PChar('play '+Ansistring(#34+MySoundFile+#34)),Nil,0,0); But still it works if my file name has no spaces, but does not work if there are spaces. I think maybe it’s my conversion to a PChar, but it works as long as there are no spaces, so I don’t know. The name of my file is in a string because it comes from a record with a string variable in it.. part of another whole system that I don’t want to change just to get this to work. Any one have any ideas how to get long file names with spaces to work? James
_______________________________________________ fpc-pascal maillist - fpc-pascal@lists.freepascal.org https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal