The following code illustrates how to return the last error condition.
HMMIO hmmio1; ULONG rc; ... rc = mmioGetLastError( hmmio1 ); if (rc) /* error */ else ...