Posted by hypnotone in SWF Studio V3 on Apr 09 2008, 08:18 pm

An app I built failed QA for Vista (only) and I'm really stuck...

I use ssCore.ActiveX and Windows Media Player to control playback of an Audio CD and ssCore.Script for a jscript script that uses the WMP's cdromCollection to eject the CD. The eject script works but the activeX fails. (OCX returns not registered and I can't create the object).

After days of research, I was finally able to determine that the OCX is indeed not registered. I got this from the MSDN forum

QUOTE:
COM uses HKEY_CLASSES_ROOT for machinewide settings but also allows per-user configuration of CLSIDS for greater security and flexibility. COM first consults HKEY_CURRENT_USER\Software\Classes before looking under HKEY_CLASSES_ROOT.

In my registry (Vista Ultimate 32, SP1), the OCX is not in HKCU but is in HKCR, and my exe is clearly not looking there. So I figured I needed a manifest, right? I used the one in the help files and made the name/privileges changes and nogo. I then checked "Run this program as administrator" and still no difference.

Any thoughts as to what's going on? My only alternative is to rewrite the entire thing in jscript (still baffled as to why that works, but at least it gives me an option), so if somebody could save me I would be immensely grateful.


Posted by northcode in SWF Studio V3 on Apr 10 2008, 10:25 am

As long as the OCX is installed and registered there's no reason you can't create the object. Instantiation only requires a registry read, not a write - which should not cause any problems.


Posted by hypnotone in SWF Studio V3 on Apr 11 2008, 09:38 am


QUOTE: from northcode;43909
As long as the OCX is installed and registered there's no reason you can't create the object. Instantiation only requires a registry read, not a write - which should not cause any problems.

That's what I thought, but I can't instantiate and isRegistered returns false. And instantiating works in jscript. Is it possible that the core activeX commands are looking only in HKCU and not root?


Posted by northcode in SWF Studio V3 on Apr 11 2008, 09:45 am

We actually look at HKEY_CLASSES_ROOT only (requesting read only access) for the isRegistered check. If that fails we don't attempt to instantiate the control.


Posted by hypnotone in SWF Studio V3 on Apr 12 2008, 10:43 am

And the .OCX is in HKCR, yet isRegistered returns false. If I make the call with Jscript instead, it finds it OK.


Posted by northcode in SWF Studio V3 on Apr 16 2008, 10:55 am

What's the OCX you're trying to use? We can install it here under Ultimate and see if we can reproduce the problem. If we can reproduce it, we can probably figure out what's going on and how to fix it.


Posted by hypnotone in SWF Studio V3 on Apr 18 2008, 03:09 pm

It's Windows Media Player, as installed with Vista -- no modifications of security settings. Do you want to see the script?


Posted by northcode in SWF Studio V3 on Apr 18 2008, 04:25 pm

Sure, I'm going to try it here under Virtual PC as well. I do know that WMP comes preinstalled on Vista, I also know you have to run it once to set it up before you can use it. I have to do that every time I start Vista in Virtual PC.


Posted by hypnotone in SWF Studio V3 on Apr 20 2008, 04:13 pm

The QA folks were running Vista on a PC. I am developing on Paralells, so I tried opening WMP and then running the app. Nogo.

Codewise, the first point of failure is here

var r = ssCore.ActiveX.createObject({object:"axControl", progId:"WMPlayer.OCX.7"});

I can't create the object. Testing to see if the ocx is registered returns false.

Then, I use the object to get the duration of a file (sc.auopath = first track on an external CD, ie D:\\track01.cda)

ssCore.axControl.setProperty({property:"URL", value:sc.auopath});
var ssro = ssCore.ActiveX.getProperty({object:"axControl", property:"currentMedia.Duration"});


JScript detects the ocx fine, but I'm having trouble writing the code to detect the duration, so dunno about that.


Posted by northcode in SWF Studio V3 on Apr 21 2008, 02:01 pm

There was a bug. When the registry entry that points to the DLL or the OCX has a system variable that needs to be expanded then the isRegistered check and the createObject call will both fail. I've fixed this in the current development build.