views:

496

answers:

3

Bleh; Knowing how to ask the question is always the hardest so I explain a little more.

I'm using CAxWindow to create an IE window internally and passing in the URL via the string class argument:

CAxWindow wnd;
m_hwndWebBrowser = wnd.Create(m_hWnd, rect, m_URI, WS_CHILD|WS_DISABLED, 0);

It's part of an automated utility for anyone to get images from their "internal" javascript-based apps; the issue is that some people try getting images from their apps that have lots of errors; The errors fire off the IE debug window and my capture utility sits waiting for input.

Initially I thought I could disable the debugging ability via IE in windows however the process that Apache runs in and hence my App is via the SYSTEM account; not sure how I'd change the debugging options without hacking the registry.

A: 

Would it be possible to just wrap everything in a try / catch in the javascript code that is being displayed in the CAxWindow at that URL? That would allow you to squelch all the errors, hopefully.

Allen
Tried that; although an "exception" is being thrown it's already being handled via the web browser UI.
widgisoft
I was referring to a try catch within the HTML, not the code calling the html
Allen
A: 

Link your app with detours or other API hooking library, hook RegQueryValue function from advapi32 and return "yes" when IE queries value for registry key "HKCU\Software\Microsoft\Internet Explorer\Main\Disable Script Debugger".

Constantin
A: 

I found some projects on CodeProject that does something similar...

http://www.codeproject.com/KB/shell/popupblocker.aspx?fid=15235&df=90&mpp=25&noise=3&sort=Position&view=Quick&fr=51&select=646577

http://www.codeproject.com/KB/shell/popupblocker2.aspx?df=100&forumid=15709&fr=51&select=548519#xx548519xx

And also an MSDN article regarding web browser customisation:

http://msdn.microsoft.com/en-us/library/aa770041(VS.85).aspx

I found that what I was after was two interfaces called: IOleCommandTarget and IDocHostUIHandler; I needed to override the UI handler and interpret the Script exception messages and respond with a "false" to indicate I didn't care about the error;

Unfortunately I spent waaaaay too much time getting my head back into COM and trying to get their god awful system set up that I wasn't able to finish it and after a discussion with my bos regarding spending more time trying to get this working or just disabling debug in IE; we chose the later.

3 Words; I hate COM :-p (the smilie doesn't count)

I think the path I was on would solve the issue I had and my response can contribute as an "answer"; sorry if it's not what you're looking for.

widgisoft
Only MS could use brackets in their URLs :-p
widgisoft