Article ID: 94209
The information in this article is included in the documentation starting with Visual C++ 5.0. Look there for future revisions.
Version 1.2 of the Microsoft Source Profiles includes two executable files: PROFILE.EXE and PROFILEW.EXE. PROFILEW.EXE is a Microsoft Windows-hosted source profile utility that can run from the command line or from an icon in the Microsoft Windows operating system. The names of batch files used to profile a Windows-based application end with the letter "W." Run these batch files from the MS-DOS prompt because each one starts Windows. You also can profile a Windows-based application in Windows.
The text below provides the steps to profile function timing in the GENERIC sample application provided with the Microsoft Windows Software Development Kit (SDK). The explanation assumes that the GENERIC sample is installed in the C:\WINDEV\GUIDE\GENERIC directory and that the Source Profiler is installed in the C:\PROFILER\BIN directory. The procedure has three main steps, as follows:
Create the PCF and Run PREPThe PCF (Profiler Command File) provides greater control to select the parts of the executable program to profile. The PCF is optional and is not necessary to collect statistics about all functions of the application.
With the following PCF, the profiler collects statistics only for the main window procedure and for the About dialog box procedure in GENERIC. For more information on PCFs, see chapter 4 of the Source Profiler "User's Guide." Place the following text into the GENERIC.PCF file:
To use this file, perform the following three steps:
You can place the PREP command into the makefile that builds profiling versions of your application. Run the PREP utility after building the executable file.
Create an Icon for Profiling and Profile the ApplicationPerform the following seven steps:
Create an output File with PREP and PLISTPerform the following two steps:
Even though GENERIC.TXT lists all the functions in the GENERIC application, it contains timing and hit statistics for only the About() and MainWndProc() functions.
Article ID: 94209 - Last Review: June 17, 2014 - Revision: 3.0
Retired KB Content Disclaimer
This article was written about products for which Microsoft no longer offers support. Therefore, this article is offered "as is" and will no longer be updated.