In-process COM servers are usually compiled as DLL or OCX files. They run in the address space of the process that uses the COM server. That is why you should either specify a host application for this DLL (OCX) or add it to the AQTime project that contains an EXE file. The rest of this topic provides step-by-step instructions on profiling in-process COM servers.
About Normal and COM Server Profiling Modes
AQTime provides two modes for profiling COM applications: Normal and COM Server.
Normal mode can be used if the client application (client process) that will use your in-process COM server is launched by AQTime.
If the client process is not launched by AQTime, use COM Server mode. For instance, you can use the COM Server mode when --
-
your in-process COM server is started by a DCOM request from another computer (in this case, the client process for your COM server is dllhost.exe launched by the operating system). See also Profiling DCOM Servers.
-
your server is launched by a request sent from a Web page (in this case, the Internet Information Services process, inetinfo.exe, becomes the client process for your COM server).
-
etc.
For more information about these profiling modes, see Profiling COM Applications - Overview.
Profiling in Normal Mode
To profile your in-process COM server in Normal mode, follow the steps below:
-
Compile your COM application with debug information. See How AQTime Profilers Use Metadata and Debug Information for detailed instructions on how to do this.
-
Be sure the “debug” version of your COM server is registered in the system. If the server was compiled on your machine, it was registered during compilation. In any case, you can use the regsvr32 utility located in the <Windows>\System32 folder to register the control, for example:
regsvr32.exe <Path>\MyServer.DLL -
Select Normal from the Profiling Mode dropdown list box that is displayed on AQTime’s Standard toolbar.Select Normal from the Profiling Mode dropdown list box that is displayed on Visual Studio’s AQTime toolbar.Click the Normal button on RAD Studio’s AQTime Profiling Modes toolbar.
-
Open your COM application in AQTime. You can either
-
Open it as a separate AQTime project. In this case, you will have to specify a host application for the DLL (OCX) in the Run Parameters Dialog (for Normal Mode).
-- or --
-
Add your DLL (OCX) to the project that holds an EXE file, which will load this DLL (OCX):
-
To add your module to the project, click the Add Module item on the toolbar or context menu of the Setup panel.
-
Set the EXE as the “main” module in the project. To do this, right-click EXE in the Setup panel and select Set as Active from the context menu.
-
In 64-bit versions of Windows, 32-bit modules can be loaded into 32-bit processes only and 64-bit modules can be loaded into 64-bit processes only. So, if the “bitness” of your COM server does not match the “bitness” of the process, to which the server is loaded, AQTime will not start profiling. -
-
Start profiling and perform it in the usual manner. Keep in mind that to profile a function (unit, class) you must check it within a custom area or select Entire .NET Code or All Project Modules to profile all the routines.
Profiling in COM Server Mode
To profile your in-process COM server in COM Server mode, perform the following steps:
-
Compile your COM application with debug information. See How AQTime Profilers Use Metadata and Debug Information for detailed instructions on how to do this.
-
Make sure the “debug” version of your control is registered in the system.
-
Open the DLL or OCX module that contains your COM server in AQTime.
-
Select COM Server from the Profiling Mode dropdown list box that is displayed on AQTime’s Standard toolbar.Select COM Server from the Profiling Mode dropdown list box that is displayed on Visual Studio’s AQTime toolbar.Click the COM Server button on RAD Studio’s AQTime Profiling Modes toolbar.
-
Select Run > Parameters from AQTime’s main menuSelect AQTime > Parameters from Visual Studio’s menuSelect AQTime > Parameters from RAD Studio’s main menu. This will open the Run Parameters Dialog (for COM Server Mode). In the dialog:
-
In the Client Application box, enter the name of the executable that will load your COM server.
-
Press OK to close the dialog.
-
-
Press Run to start profiling. Select AQTime > Run (or select Debug > Run while one of AQTime panels is active) to start profiling.Select AQTime > Run With Profiling to start profiling. AQTime will display a dialog asking you to launch the COM client application.
-
Launch the COM client application that will work with your server.
-
Continue profiling in the usual manner.
See Also
Profiling COM Applications
Profiling Out-of-Process COM Servers