How to debug a COM object in Visual Studio 6.0 that is created in an ASP page?

I have an old C ++ COM component that needs to stay in Visual Studio 6.0 format. I have never been able to figure out how to debug code in a real COM component in my entire life.

I can build it in debug mode, add breakpoints and attach it to the dllhost.exe process, but Visual Studio will only show me the disassembly from dllhost.exe, not my original code (it also doesn't work and doesn't stop at breakpoints) ...

I remember a while ago there was a way to make IIS (or inetinfo.exe) the target of your debug action (that is, when Visual Studio 6.0 asks you to run the dll executable) and IIS would run in a single process mode. There was a registry key that you need to change, but googling didn't help.

+1


source to share


2 answers


If it is a VB6-based COM component, you can open the project in VB6 and run it (DLL project cannot run). The properties of the project have some parameter, thanks to which it can be asked to start so that it starts and registers.



Now try pushing the ASP page that makes the call to the COM component. Breakpoints set in class files will be removed because the calls are made from the ASP page.

+2


source


First of all, the PDB file (created at compile time) must be in the same directory with the DLL (can be set in the project properties).

If your object does not use some ASP-specific functionality (request, response, session objects), you can copy its invocation code to a .vbs file and debug using the cscript.exe your.vbs parameter as a debug target.



There are explanations ( for example ) on how to debug an ISAPI DLL - they also apply to your COM object (from the OS / debugger point of how DLLs are loaded into an IIS process). Pay attention to your IIS version and in / out of the process.

And finally, if all else fails, you can add some entries with OutputDebugString and see it in the free DebugView .

0


source







All Articles