0
votes

Although I have many years Delphi experience, this is my first exposure to Com+. My client have a Com+ application that I have to maintain. In the end-user world, the DLL gets run by a MSC (Microsoft Common Console Document) application. How can I debug this DLL? I have set the host application under the debugger options to C:\WINDOWS\SYSTEM32\DLLHOST.EXE and the Parameters to /ProcessID:{Application ID from Component Services}. The DLL runs but it does not give me any exposure/access to the GUI aspects of the DLL. All my break-points are also set to green (not reachable).

2
I don't have any experience with such things but I would suggest you first check the MSC Application that is running this DLL to se how it does that. Note that MSC applications are actually XML files containing specific XML code that can be parsed by Microsoft Management Console to do certain things. So checking the XML code stored in this MSC program might give you a better clue of how DLL is actually ran and thus perhaps allow you to run that same DLL yourself.SilverWarior

2 Answers

0
votes

Did you find this 'Application ID from Component Services' in your local configuration of the Component Services? If you do, keep the Component Services view open, and switch to the alternate report view that shows the current processes. There should be no running process for your component, until you start the debugger (and DLLHOST.EXE that will connect to the COM+ management). Only then, when a first COM+ request is made for an object of your component, the debugger will see the DLL get loaded and be able to catch exceptions and breakpoints.

0
votes

In the end, this has solved my problem: Under Project -> Options -> Delphi Compiler -> Compiling: Change the Optimization to FALSE and the Stack frames to TRUE

Under Project -> Options -> Delphi Compiler -> Linking: Set the Include remote debug symbols to TRUE.

Run -> Parameters must look like this: enter image description here

The ProcessID is the Application ID from your COM+ Application in Component Services (right click on your COM+ application and select Properties): enter image description here

Remember to rebuild and register your DLL when all that changes have been made.