The following code illustrates how to write to disk.
HMMIO hmmio1; USHORT usFlags = 0; USHORT rc; ... rc = mmioFlush( hmmio1, usFlags); if (rc) /* error */ else ...