SAMPLE: Illustrates Multithreaded Programming TechniquesLast reviewed: September 30, 1997Article ID: Q108433 |
The information in this article applies to:
SUMMARYThe MTDLL sample illustrates several techniques and concepts related to multithreaded programming in Win32. The sample uses a multithreaded dynamic-link library (DLL) to implement six sorting algorithms. The DLL is called into from a Microsoft Foundation Class (MFC) Libraries application that uses a dialog box as the main window. The six sorting algorithms implemented are the Bubble sort, Exchange sort, Heap sort, Insertion sort, Quick sort, and Shell sort. NOTE: The sample code has been built using the Visual C++ version 2.0. If you are using newer versions 4.0 or 4.1 you will need to convert the project files to Developer Studio projects. All you need to do is to open a workspace specifying SORTDEMO.MAK and SORTDLL.MAK file. The Developer Studio will pop up a message box prompting you for the project name and it will do a conversion for you. The following file is available for download from the Microsoft Software Library:
~ Mtdll.exe (size: 64311 bytes)For more information about downloading files from the Microsoft Software Library, please see the following article in the Microsoft Knowledge Base:
ARTICLE-ID: Q119591 TITLE : How to Obtain Microsoft Support Files from Online Services MORE INFORMATIONSome of the multithreaded concepts and techniques illustrated by the sample are:
This sample does not use .DEF files to specify exported functions. It illustrates using __declspec instead. However, the sample does include .DEF files for the DLL and the executable, which can be used as starting points if at some point the LIB utility needs to be used with the /DEF option to solve the problem of mutual imports. This sample also uses CTL3D32.DLL to implement a 3-D look for its dialog box controls. For CTL3D32.DLL to work, however, it must be copied from the multithreaded DLL sample directory to the Windows NT SYSTEM32 subdirectory, for example C:\WINNT\SYSTEM32. After copying the DLL, it must be deleted from the multithreaded DLL sample directory. If CTL3D32.DLL is not copied to the \WINNT\SYSTEM32 directory and deleted from the multithreaded DLL sample directory, a message box with the following error will be displayed when the sample is run:
This application uses CTL3D32.DLL, which has not been correctly installed.After choosing OK to dismiss the message box, the main dialog box of the sample is displayed but it uses a white background and none of the dialog box controls will be 3-D. Keywords : CRTIss kbfasttip Version : WINDOWS NT:1.0,2.0,2.1,4.0,4.1,5.0; Platform : NT WINDOWS Issue type : kbfile |
================================================================================
© 1998 Microsoft Corporation. All rights reserved. Terms of Use. |