IE7 and ActiveXObject Fails?

P

phplasma

Hi,

I'm having an issue trying to instance/access the DRM GetLicense
functionality of the Windows rights SDK in IE7.

This works fine for me in IE6, however in IE7 another user cannot
instance the object correctly.

For example, run this test: http://bpa-usage.com/plasma/temp/drm.html

Click 'run diag test', which will try and instance the SDK object and
then return the version number.

This works in IE6, but not IE7.

Any ideas? I've had a look around both the Microsoft site, newsgroups
and google in general and cannot seem to find any information.

Thanks
 
V

VK

I'm having an issue trying to instance/access the DRM GetLicense
functionality of the Windows rights SDK in IE7.

Of course you cannot do that out of the sky blue. It fails on my IE6 as
well.

<snip code>
new ActiveXObject("DRM.GetLicense.1")
<snip code>

ActiveXObject is not a tool to access any given object in Windows OS.
It is merely a tool to access the automation control objects: if they
were installed and registered properly and if the activation was not
locked by security settings.

As I (neither the problematic machine in your case) never installed the
relevant .ocx file then it is natural that I cannot activate it.
 
V

VK

P

phplasma

Thanks.

I've setup another example at
http://bpa-usage.com/plasma/temp/extern.html

This has the source:

--
<script type='text/javascript' src='functions.js'></script>
<script Language="JavaScript">
function ExternalTest()
{
alert("Start Test");
alert("obj is " + GetLicenseObj);
var result = GetLicenseObj.GetDRMVersion();
alert("version: " + result);
alert("end test");
}

</script>
</head>
<script type="text/javascript">rendercode();</script>
</body>
</html>

<a href="javascript:ExternalTest()">run extern test</a>
--

With the rendercode() method inside functions.js containing:

--
function rendercode()
{
document.write('<object
classid="clsid:A9FC132B-096D-460B-B7D5-1DB0FAE0C062"
height="0"id="GetLicenseObj" width="0"> <embed mayscript
type="application/x-drm-v2" hidden="true"></object>');
}
--

Yet I still get no different in IE7, just the same error where there is
no 'GetDRMVersion()' method. Works fine in IE6.

(Does write need be writeln by chance? Dont know if it matters)

Any other idea's appreciated, I will cross-post this with another group
too.
 
V

VK

Yet I still get no different in IE7, just the same error where there is
no 'GetDRMVersion()' method. Works fine in IE6.

That's getting really IE-exclusive and usually such topics are off for
c.l.j. At the same time it would be not helpful to send you for help on
such topic to m.p.s.j. So as an exception... :)

ActiveX is a very funny matter by itself (Eolas is just an icing on the
cake). If you have some program installed and "visible" to one UA
installation - it doesn't guarantees at all that it will be "visible"
to another UA installation. UA are "loosing" components left and right
because of bad registry mechanics; respectively one has to edit
registry manually or reinstall UA or (most often) install new UA first
and then reinstall all other components atop. So before blaming Eolas
let's us see if the registry did not get screwed.

Run the code below and tell what alerts will you see:
(watch line breaks)
(Firefox 2 or IE7 as my next security choice? whatch and think about
:)

<html>
<head>
<title>Test</title>
<meta http-equiv="Content-Type"
content="text/html; charset=iso-8859-1">

<script type="text/javascript">
/*@cc_on
@if (@_jscript_version >= 5.5)
var MSIE = true;
var probe = null;
document.namespaces.add('vk', 'VK/[email protected]',
'#default#clientcaps');
@else @*/
var MSIE = false;
/*@end @*/

function init() {
if (!MSIE) {
return null;
}
else {
try {
var head = document.getElementsByTagName('head')[0];
probe = document.createElement('vk:probe');
head.normalize();
head.appendChild(probe);
window.setTimeout('detectFeatures()', 100);
}
catch(e) {
window.alert(e.message);
}
}
}

function detectFeatures() {
var WMP =
probe.isComponentInstalled('{22D6F312-B0F6-11D0-94AB-0080C74C7E95}',
'ComponentID');
if (WMP) {
var VER =
probe.getComponentVersion('{22D6F312-B0F6-11D0-94AB-0080C74C7E95}',
'ComponentID');
window.alert('Windows Media Player ' + VER);
var DRM =
probe.isComponentInstalled('{A9FC132B-096D-460B-B7D5-1DB0FAE0C062}',
'ComponentID');
if (!DRM) {
window.alert('Current agent cannot bridge to DRM ActiveX.')
}
}
else {
window.alert('Windows Media Player is not installed');
}
}

window.onload = init;
</script>
</head>

<body>
</body>
</html>
 
P

phplasma

Thanks for that.

I gave it a go and I get (after the version info) "Current agent cannot
bridge to DRM ActiveX."

Does this supposedly mean I would not be able to use the license stuff?
Because I could on my PC here.

Ideally I would like to make a solution compatible for all browsers,
but I don't see that happening at the moment.
Yet I still get no different in IE7, just the same error where there is
no 'GetDRMVersion()' method. Works fine in IE6.

That's getting really IE-exclusive and usually such topics are off for
c.l.j. At the same time it would be not helpful to send you for help on
such topic to m.p.s.j. So as an exception... :)

ActiveX is a very funny matter by itself (Eolas is just an icing on the
cake). If you have some program installed and "visible" to one UA
installation - it doesn't guarantees at all that it will be "visible"
to another UA installation. UA are "loosing" components left and right
because of bad registry mechanics; respectively one has to edit
registry manually or reinstall UA or (most often) install new UA first
and then reinstall all other components atop. So before blaming Eolas
let's us see if the registry did not get screwed.

Run the code below and tell what alerts will you see:
(watch line breaks)
(Firefox 2 or IE7 as my next security choice? whatch and think about
:)

<html>
<head>
<title>Test</title>
<meta http-equiv="Content-Type"
content="text/html; charset=iso-8859-1">

<script type="text/javascript">
/*@cc_on
@if (@_jscript_version >= 5.5)
var MSIE = true;
var probe = null;
document.namespaces.add('vk', 'VK/[email protected]',
'#default#clientcaps');
@else @*/
var MSIE = false;
/*@end @*/

function init() {
if (!MSIE) {
return null;
}
else {
try {
var head = document.getElementsByTagName('head')[0];
probe = document.createElement('vk:probe');
head.normalize();
head.appendChild(probe);
window.setTimeout('detectFeatures()', 100);
}
catch(e) {
window.alert(e.message);
}
}
}

function detectFeatures() {
var WMP =
probe.isComponentInstalled('{22D6F312-B0F6-11D0-94AB-0080C74C7E95}',
'ComponentID');
if (WMP) {
var VER =
probe.getComponentVersion('{22D6F312-B0F6-11D0-94AB-0080C74C7E95}',
'ComponentID');
window.alert('Windows Media Player ' + VER);
var DRM =
probe.isComponentInstalled('{A9FC132B-096D-460B-B7D5-1DB0FAE0C062}',
'ComponentID');
if (!DRM) {
window.alert('Current agent cannot bridge to DRM ActiveX.')
}
}
else {
window.alert('Windows Media Player is not installed');
}
}

window.onload = init;
</script>
</head>

<body>
</body>
</html>
 
R

Randy Webb

VK said the following on 11/6/2006 12:37 PM:
That's getting really IE-exclusive and usually such topics are off for
c.l.j.

IE specific JScript is off-topic to clj but you want to include a
snippet in the clj FAQ dealing with CSS? Amazing what your thought
process entails sometimes.
 
V

VK

I gave it a go and I get (after the version info) "Current agent cannot
bridge to DRM ActiveX."

Does this supposedly mean I would not be able to use the license stuff?
Because I could on my PC here.

Ideally I would like to make a solution compatible for all browsers,
but I don't see that happening at the moment.

This is as far as JavaScript goes:

<script type="text/javascript">
if (window.ActiveXObject) {
// IE
try {
var DRM = document.getElementById('DRMObject');
window.alert(DRM.GetSystemInfo());
// where "DRMObject" is ID of your <object>
// inserted onto page over the Eolas workaround
}
catch(e) {
window.alert(e.message);
}
}
else if (window.GeckoActiveXObject) {
// Firefox, Netscape 7>
try {
var DRM = new GeckoActiveXObject('DRM.GetLicense.1');
window.alert(DRM.GetSystemInfo());
}
catch(e) {
window.alert(e.message);
}
}
else {
window.alert('ActiveX is not supported');
}

</script>

If you are getting errors, then the corresponding ActiveX registration
on current machine is broken or lost and nothing what script could do
in the default security environment :-(

In such case solve the problem by brut force (by re-installing player)
or search/contact Microsoft for needed registry settings.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,904
Latest member
HealthyVisionsCBDPrice

Latest Threads

Top