winapi - mciSendString with Visual C++ - Parameters? -
i not native c++ programmer, need following:
i got code working:
#pragma comment(lib, "winmm.lib") lpcwstr opencdcommand = l"set cdaudio door open"; //comes windows.h, needs winmm.lib see header includes int errcode = mcisendstring(opencdcommand, 0, 0, 0);
questions:
- do need work lpcwstr? why didn't find system::string example?
- how should handle 'string concatination'? cant l"foo"+l"baar"?
- am on totally wrong way play sounds mcisendstring? (actually want use mci command , mci sendstring did in other projects before)
- is there way include external function mcisendstring can handle handles?
the signature of mcisendstring is
mcierror mcisendstring( lpctstr lpszcommand, lptstr lpszreturnstring, uint cchreturn, handle hwndcallback);
so, regarding first 2 parameters, in unicode wchar pointer , in multibyte char pointer. it's signature. cannot change , shouldn't worry that.
std::wstring somestring( l"foo" );
somestring.append( l"bar ");
i play sound core audio api, waveout or maybe directsound. but, not
mcisendstring()
.i'm afraid don't understand one.. can explain better?