Microsoft's sample code address: https://msdn.microsoft.com/en-us/library/sky96ah7
I put it in the HTML code stored in the test. The HTML, then open the test in IE. HTML,
Has been performed to
BstrName=SysAllocString (OLESTR (" cat "));
Hr=pdexScript - & gt; GetDispID (bstrName, 0, & amp; Dispid);
Are right, obtain the dispid, but behind the InvokeEx returned E_ACCESSDENIED error, have to know, please show,
<body>The function (cat)
{
//Create the new element and assign the value 10
This. Bar=10;
}
The function test ()
{
//the Construct of new object
Obj=new Object ();
//Create the new element and assign the function pointer
Obj. Elem=cat;
//Call Elem method (" this "==Obj)
Obj. Elem ();
//Obj. Bar now exists
}
test();
</script>