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?

  1. 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.

  1. std::wstring somestring( l"foo" ); somestring.append( l"bar ");

  2. i play sound core audio api, waveout or maybe directsound. but, not mcisendstring().

  3. i'm afraid don't understand one.. can explain better?


Popular posts from this blog

Php - Delimiter must not be alphanumeric or backslash -

Delphi interface implements -

java - How to create Table using Apache PDFBox -