Article ID: 108433 - Last Review: April 29, 2005 - Revision: 4.0 Descriptions of multithreaded programming techniquesThis article was previously published under Q108433 SUMMARY The 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 Visual C++, version 2.0. If you are using versions 4.0 or later, you need to convert the project files to Developer Studio projects. To do so, open a workspace specifying SORTDEMO.MAK and SORTDLL.MAK file. A message box appears that prompts you for the project name and it does a conversion for you. Visual C++ 5.0 and 6.0 cannot convert the Sortdll.mak. A makefile wrapper project is generated instead. The following files are available for download from the Microsoft Download Center: Collapse this image ![]() 119591
(http://support.microsoft.com/kb/119591/
)
How to obtain Microsoft support files from online services
Microsoft scanned this file for viruses. Microsoft used the most current virus-detection software that was available on the date that the file was posted. The file is stored on security-enhanced servers that help prevent any unauthorized changes to the file.
MORE INFORMATION Some 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. You may receive a linker error of the type: error
LNK2001: unresolved external symbol _Ctl3dxxxxxxxx APPLIES TO
| Article Translations
|



Back to the top
