(WinXP, Borland C++ Free Command Line Compiler)
Ok, something very strange is going on in my code. This should place a .mid, and return a handle:
Code:
#include <windows>
#include <string>
#include <iostream>
using namespace std;
HANDLE Order(SHORT order, string PATH) {
string Muz;
HANDLE Handler;
if(order == 0)
Muz+="play ";
else
Muz+="stop ";
Muz+=PATH;
cout << Muz << endl;
mciSendString(Muz.c_str(), NULL, 0, Handler);
return Handler;
}
int main() {
Order(0, "C:\\TW.mid");
Sleep(4500);
Order(1, "C:\\TW.mid");
}
But I get something about casting from a void pointer to an HWND__ pointer...
Code:
C:\Borland\BCC55\Bin>BCC32 C:\SoundTest.cpp
Borland C++ 5.5.1 for Win32 Copyright (c) 1993, 2000 Borland
C:\SoundTest.cpp:
Error E2034 C:\SoundTest.cpp 18: Cannot convert 'void *' to 'HWND__ *' in function Order(short,string)
Error E2342 C:\SoundTest.cpp 18: Type mismatch in parameter 'hwndCallback' (wanted 'HWND__ *', got 'void *') in function Order(short,string)
*** 2 errors in Compile ***
Why is it even bringing this up? It does want a HANDLE doesnt it? I've never had this problem before... :/. Whats it want me to do >.>. Oh, and what is that handle for anyways? I know I could specify a NULL, but is it used for something?
Thanks!