views:

184

answers:

3

For a long time I would throw up a DebugBreak() or ASSERT(false) in the startup code of my ActiveX control, load up IE, go to a localhost page hosting my control, wait for the dialog to show up, then debug my application. I could also launch it under the debugger by setting IE as the container.

I tried again for the first time in 2 months and now this no longer works. If I use the ASSERT(false) method, when I get the Visual C++ Debug dialog and click "retry", IE simply closes without any debugger activity. When I try launching from VS2008 and hoping the DebugBreak() will kick in after I load the page, VS2008 does break, but it says either the "RPC Server is Unavailable" or the "RPC Client Call failed." I am never allowed to have my application in the debugger and it doesn't show up in the modules list of VS. The stack trace in VS2008 only contains Microsoft DLLs and modules and not a hint of my code.

I assume it's something I've picked up through Windows Update that broke this. Has anyone else ever seen this issue and know how to make it go away? As it stands, I'm now completely unable to debug my ActiveX control.

A: 

Can you use 'Attach to Process' in Visual Studio and make sure the 'Attach To' is set to Native code ?

Russ C
Attaching has the same result as if I'd started under the debugger or tried to use an assert to break in. My control still doesn't show up in the modules window of VS and my breakpoints are all the "outlined circle" showing that they won't cbreak in.
Phenglei Kai
A: 

Hi,

I faced exactly the same problem like you, but it turned that the reason is IE itself, not Visual Studio - here is what a friend of mine showed me:
- IE8 opens many processes at least one for each tab plus one more. This confuses the debugger.
- You can disable this "feature" and (for me) debugging started to work,
- I still cannot "Attach to process", but putting IE as debug application is fine.

Here is how you disable it:

To overcome this issue, you need to disable the process growth feature of LCIE by follow the below steps:

1) Open RegEdit
2) Browse to HKEY_LOCALMACHINE -> SOFTWARE -> Microsoft -> Internet Explorer -> Main
3) Add a dword under this key called TabProcGrowth
4) Set TabProcGrowth to 0

If you run into the same problem on Vista or newer, you will also need to turn off >protected mode.

I've tested on Win XP so far. Help came from this link: http://weblogs.asp.net/abdullaabdelhaq/archive/2009/06/01/VS-Debug-Problem-with-IE8.aspx

Good Luck!

This worked well, but I swear I was able to get it working with TabProcGrowth set to 1, somehow, before.
Phenglei Kai
A: 

Note that if you're using 64-bit Windows, you need to create TabProcGrowth in the 32-bit registry, NOT the normal registry.

To do that, open %systemroot%\syswow64\regedit instead of just regedit.

For more details, see http://support.microsoft.com/kb/305097

nanki