After much trial and error, I finally found out a way to make it work. To those who are facing the same problem as me, here it goes:
//if you are using unicode
LPCWSTR a = L"open cannon.mp3 type mpegvideo";
int error = 99;
error = mciSendString(a, NULL,0,0);
int error2;
LPCWSTR b = L"play cannon.mp3";
error2 = mciSendString(b, NULL, 0, 0);
//cannon.mp3 is stored in my resource file
//error is just for debugging
//if you are using multibyte
LPCSTR a = "open cannon.mp3 type mpegvideo";
mciSendString(a, NULL, 0,0);
LPCSTR b = "play cannon.mp3 repeat";
int error2 = mciSendString(b, NULL, 0, 0);