Profile an OLE Server or ActiveX Control

OverviewDetails

Profile Dynamic-Link Libraries explains the steps involved in profiling dynamic-link libraries and profiling multiple .DLL and .EXE files.

Feature Only in Professional and Enterprise Editions   Profiling is supported only in Visual C++ Professional and Enterprise Editions. For more information, see .

Since an OLE server is basically an EXE or a DLL, and an ActiveX control (formerly OLE control) is a DLL even though it has an extension of .OCX, profiling them is similar to profiling an EXE or a DLL. When you profile an OLE server or ActiveX control, you follow the same steps and use the same commands that you would for an EXE or a DLL. The same profiling rules that apply to EXEs and DLLs (such as the need to include debugging information and to supply a .MAP file) apply to OLE servers and ActiveX controls.

The four examples below illustrate the steps required to profile a full OLE server, a mini OLE server, an in-process Automation server (formerly OLE Automation server), and an ActiveX control.

You may need to register the mini OLE server, the in-process Automation server, or the ActiveX control explicitly. You can do one of the following steps to register them:

  • For a DLL (and thus for an ActiveX control), run REGSVR32 from the command prompt. Alternatively, you can open the corresponding project in the development environment and select the Register Control option from the Tools menu.

  • For an EXE, simply run the executable file. You may not be able to run it or you may get a message saying, "This server can only be run from a container application," but you can click OK. It will have been registered.

In order to run the profiler, you may need to copy the \Program Files\Microsoft Visual Studio\VC98\bin \PROFILE.DLL file to the directory containing the file that you are profiling, or to one of the system directories.

Each step in the following examples is a command at the command prompt.  Alternatively, you could create a batch file with these commands.

To profile a full OLE server or an Automation server:

PREP /OM /FT FullSrvr
PROFILE FullSrvr
PREP /M FullSrvr
PLIST FullSrvr > FullSrvr.txt

where FullSrvr.exe is the file corresponding to a full OLE server or Automation server.

To profile a mini OLE server:

COPY MiniSrvr.exe MiniSrvr.sav
PREP /OM /FT MiniSrvr
COPY MiniSrvr._xe MiniSrvr.exe
PROFILE /I MiniSrvr /O MiniSrvr Container
PREP /M MiniSrvr
PLIST MiniSrvr > MiniSrvr.txt
COPY MiniSrvr.sav MiniSrvr.exe

where MiniSrvr is the file corresponding to a mini OLE server and Container is a container application that runs the MiniSrvr.

To profile an in-process Automation server (the steps are similar to those of a mini OLE server except that you have a .dll extension instead of .exe):

COPY InProc.dll InProc.sav
PREP /OM /FT InProc.dll
COPY InProc._ll InProc.dll
PROFILE /I InProc /O InProc Client
PREP /M InProc
PLIST InProc > InProc.txt
COPY InProc.sav InProc.dll

where InProc is the file corresponding to an in-process Automation server and Client is an Automation client application that drives the InProc.dll.

To profile an ActiveX control with an .ocx extension (the steps are similar again except that you have an .ocx extension):

COPY Control.ocx Control.sav
PREP /OM /FT Control.ocx
COPY Control._cx Control.ocx
PROFILE /I Control /O Control ControlContainer
PREP /M Control
PLIST Control > Control.txt
COPY Control.sav Control.ocx

where Control is the ActiveX control and ControlContainer is an ActiveX control container application.