Using MMIO Editing Functions

This section shows the MMIO editing functions used by an MCD to implement media control interface editing functions. The MMIO functions and their media control interface equivalents are shown in the following table:

┌──────────────────────────────┬──────────────────────────────┐
│MMIO Functions                │MCI Equivalents               │
├──────────────────────────────┼──────────────────────────────┤
│MMIOM_DELETE                  │MCI_CUT                       │
├──────────────────────────────┼──────────────────────────────┤
│MMIOM_READ                    │MCI_COPY                      │
├──────────────────────────────┼──────────────────────────────┤
│MMIOM_DELETE                  │MCI_DELETE                    │
├──────────────────────────────┼──────────────────────────────┤
│MMIOM_UNDO                    │MCI_UNDO                      │
├──────────────────────────────┼──────────────────────────────┤
│MMIOM_REDO                    │MCI_REDO                      │
├──────────────────────────────┼──────────────────────────────┤
│MMIOM_DELETE,                 │MCI_PASTE                     │
│MMIOM_BEGININSERT, and        │                              │
│MMIOM_ENDINSERT               │                              │
└──────────────────────────────┴──────────────────────────────┘

The following example shows how to use MMIO functions to paste data into a file.

/*******************************************
* Remove the information in the file if
* from/to are specified.
********************************************/

if ( ulParam1 & MCI_FROM || ulParam1 & MCI_TO )
   {
   lReturnCode = mmioSendMessage( pInstance->hmmio,
                                  MMIOM_DELETE,
                                  pEditParms->ulFrom,
                                  ulPasteLen );

   if ( lReturnCode != MMIO_SUCCESS )
      {
      ulrc = mmioGetLastError( pInstance->hmmio );
      PasteNotify( &FuncBlock, ulParam1, ulrc );
      return ( ulrc );
      }
   }



if ( !( ulParam1 & MCI_TO_BUFFER ) )
   {
   /*******************************************
   * Let the IOProc know that the information is
   * about to be inserted into the file
   ********************************************/

   lReturnCode = mmioSendMessage( pInstance->hmmio,
                                  MMIOM_BEGININSERT,
                                  0,
                                  0 );

   if ( lReturnCode != MMIO_SUCCESS )
      {
      ulrc = mmioGetLastError( pInstance->hmmio );
      PasteNotify( &FuncBlock, ulParam1, ulrc );
      return ( ulrc );
      }

   /*******************************************
   * Write the information that we received from
   * the clipboard
   *******************************************/


   lReturnCode = mmioWrite( pInstance->hmmio,
                            ( PSZ ) pBuffer,
                            ulBuffLen );

   if ( lReturnCode == MMIO_ERROR )
      {
      ulrc = mmioGetLastError( pInstance->hmmio );
      PasteNotify( &FuncBlock, ulParam1, ulrc );
      return ( ulrc );
      }

   /*******************************************
   * We have finished inserting the information
   * the paste is complete
   ********************************************/


  lReturnCode = mmioSendMessage( pInstance->hmmio,
                                 MMIOM_ENDINSERT,
                                 0,
                                 0 );

  if ( lReturnCode != MMIO_SUCCESS )
     {
     ulrc = mmioGetLastError( pInstance->hmmio );
     PasteNotify( &FuncBlock, ulParam1, ulrc );
     return ( ulrc );
     }


[Back: Networking Functions]
[Next: Sync/Stream Operations]