SAMPLE: How to Use Multimedia Timer Services on Windows 95

Last reviewed: September 9, 1996
Article ID: Q153400
The information in this article applies to:
  • Microsoft Win32 Software Development Kit (SDK) version, 4.0

SUMMARY

MTHUNK32 contains a sample application that demonstrates the implementation of thunking code necessary for 32-bit applications running on Windows 95 to obtain reliable performance when using high-resolution multimedia timer services.

You can find MTHUNK32.EXE (size: 100713 bytes) 
                         , a self-extracting file, on these services:

- Microsoft's World Wide Web site on the Internet
      On the www.microsoft.com home page, click the Support icon
      Click Knowledge Base, and select the product
      Enter kbfile MTHUNK32.EXE (size: 100713 bytes) 
                               , and click GO!
      Open the article, and click the button to download the file

- Internet (anonymous FTP)
       ftp ftp.microsoft.com
       Change to the \softlib\mslfiles directory
       Get MTHUNK32.EXE

- The Microsoft Network
      On the Edit menu, click Go To, and then click Other Location
      Type "mssupport" (without the quotation marks)
      Double-click the MS Software Library icon
      Find the appropriate product area
      Locate and download MTHUNK32.EXE

  • Microsoft Partner Network (MSPN)

          On MSPN Desktop, double-click the Software Library icon
          Search for MTHUNK32.EXE
          Display results and download
    
  • Microsoft Download Service (MSDL)

          Dial (206) 936-6735 to connect to MSDL
          Download MTHUNK32.EXE (size: 100713 bytes) 
    

    For additional information about downloading, please see the following article in the Microsoft Knowledge Base:

       ARTICLE-ID: Q119591
       TITLE     : How to Obtain Microsoft Support Files from Online Services
    
    

    MORE INFORMATION

    32-bit multimedia timer callbacks on Windows 95 are subject to noticeable performance problems due to the demands of preemptive multitasking and limitations in the Windows 95 system architecture. Running a 32-bit application at high priority does not solve this problem, but thunking to a 16-bit DLL does the job. MTHUNK32 demonstrates how a 32-bit application running on Windows 95 can utilize flat thunks via a 32-bit thunking DLL to call a 16-bit DLL that invokes a multimedia timer and services the timer callbacks.

    MTHUNK32 also implements a shared memory technique using the 16-bit and 32-bit DLLs, and a user interface for manipulating parameters in shared memory. This design allows the user to interact through the 32-bit application's GUI to modify data while it is being played back with the 16-bit multimedia services. This sort of design is needed by MIDI sequencer applications which allow a user to modify MIDI data for entire tracks or channels during playback by manipulating graphical controls or manually entering new parameters. To implement this technique on Windows 95, the 32-bit application and 16-bit DLL must share one or more blocks of fixed memory that are allocated by the 16-bit DLL. The DLL passes a pointer to the memory block through the thunking layer back to the application which then can reference the memory.


  • Additional reference words: timeSetEvent TimerProc 4.00
    KBCategory: kbmm kbprg kbfile
    KBSubcategory: MMTimer



    THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

    Last reviewed: September 9, 1996
    © 1998 Microsoft Corporation. All rights reserved. Terms of Use.