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 Answers
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.
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:
The ProcessID is the Application ID from your COM+ Application in Component Services (right click on your COM+ application and select Properties):
Remember to rebuild and register your DLL when all that changes have been made.