I have searched google and MSDN for hours trying to figure this out but it would seem my code is correct as every example I found was pretty much identical to mine.
This code is supposed to have automatic type selection according to MSDN. It works for wave files but for MP3 it returns error 277(MCIERR_INTERNAL). The only thing MSDN says about the error is to try restarting windows.
1 2 3 4 5 6 7 8 9
MCI_OPEN_PARMS op = {0};
op.lpstrElementName = Path;
MCIERROR ret = mciSendCommand(
0,
MCI_OPEN, MCI_OPEN_ELEMENT,
reinterpret_cast<DWORD_PTR>(&op));
// ret is 277
Another "solution" I found on another board where someone had a similar problem returns error 281(MCIERR_EXTENSION_NOT_FOUND). This doesn't even work for wave files.