1: add a write devise open for the write of a wave file.
if ((hFile = mmioOpen(".\\SAMPLE1.WAV", NULL, MMIO_WRITE)) != NULL) { // File opened successfully. MessageBox(hwndApp, "Failed to read data chunk.", NULL, MB_OK | MB_ICONEXCLAMATION); } else { // We can not open the file for the read MessageBox(hwndApp, "Failed to read data chunk.", NULL, MB_OK | MB_ICONEXCLAMATION); }