Accessing COM object property in JScript results in a Permission Denied error

1

Where I work we have a proprietary C++ wrapper around IE which we pull into a JScript script as a COM object.

There are a few events of this object that we wire to some JScript callbacks. The webpage "DocumentLoad" event in particular has 4 callback functions wired to it.

The code in each of these callbacks accesses properties of the browser object -- all of them access the location url (and this is the only thing accessed in the first of them).

Our problem is that there are intermittent "Permission Denied" (0x800A0046) errors in these functions when trying to access this property (which is pretty much the first thing accessed from this object in all of them). It doesn't always happen and it'll sometimes happen in some of the callbacks but not others -- usually the first callback or three will function ok, but then the rest error.

I don't think it is an actual permission denied error, which I've read usually happens when trying to access a file w/o the correct permissions or in an in-browser script when trying to access a property of a page in an iFrame from a separate domain. Neither of these are what's going on, but can't find what else it might be. I can see that it might be loosely related to the in-browser permission denied, but why the intermittancy?

I've spotted other errors in the Windows Event logs (on Windows 7) around the time when the permission denied errors are logged; they are as follows:

  • 0x80040155 - interface not registered
  • 0xC0000005 - access violation

My thought is that somehow an object is getting destroyed or something (or maybe something to do w/ threading) after a short time and that's causing the error. I'm not a COM guy though so I don't know how to go about testing/debugging this.

The permission denied error is happening on both Windows 7 (32-bit) and Windows XP (32-bit, SPK2?)

Any and all help appreciated!

com
permission-denied
jscript
asked on Stack Overflow Nov 1, 2012 by paul

0 Answers

Nobody has answered this question yet.


User contributions licensed under CC BY-SA 3.0