Hi,
I used the following code to track the error:
int ret = Beep(1000,500);
if (ret != 0)
{
char szMsgBuf[MAX_PATH] = "";
DWORD dwLastError = GetLastError();
wsprintf(szMsgBuf,"Error #%ld: ", dwLastError);
FormatMessage( FORMAT_MESSAGE_FROM_SYSTEM,
NULL,
dwLastError,
MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT),
&szMsgBuf[lstrlen(szMsgBuf)],
MAX_PATH,
NULL );
MessageBox( m_hWnd, szMsgBuf, "GetLastError", MB_OK|MB_ICONINFORMATION );
}
The message box shows "Error #6: Invalid handle" (tranlated from german "Error #6: Das Handle ist ungülltig")
Seems a little bit strange to me since the return value of Beep is definetly not zero :?.
Anybody with a clue?
Thanx
Tom