Profiling DCOM Servers

Applies to AQTime 8.81, last modified on January 18, 2022

DCOM applications are profiled in the same manner as out-of-process servers. Normally DCOM servers simply wait for a remote procedure call from a client machine. They cannot be launched by AQTime in this way. That is why the preferred profiling mode for them is the COM Server mode (this mode is supported on Windows XP, Windows Server 2003 and later operating systems):

  • Compile your DCOM 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 application is registered in the system. If the application 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
  • Open your application 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, specify the application that will load your DCOM server. For example, this can be <Windows>\System32\dllhost.exe.

    • 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 client application.

  • Launch the client application for your DCOM server.

  • Perform profiling in the usual manner.

You can also profile DCOM servers in Normal mode. There is one DCOM server feature you should keep in mind: if these servers are launched as out-of-process COM servers in Normal mode, they will not execute anything (there is no remote procedure call) and will exit immediately. The solution is to add a code snippet to the DCOM server application so that, when launched, it does not close immediately. You can achieve this by:

  • Adding an empty form (the Close button on the caption bar will allow the application to close when you are done).

  • Setting up code so that when launched the DCOM application opens the form (the exact means depend on your compiler).

You can then profile your application using the rest of the recipe for out-of-process OLE servers. Use a client machine to command operations on the DCOM server. When you close the form on the server machine, the server process will exit and AQTime will generate its results.

Note once again that the ways of profiling in Normal mode are just workarounds. In most cases, you should profile DCOM servers using AQTime’s COM Server mode.

See Also

Profiling COM Applications
Profiling Out-of-Process COM Servers

Highlight search results