Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: (Windows) Need help with codec settings in Batch Exporter script for WSH



Hi Luc-Eric,

I think there's a subtle problem with the script below: you create a CFObject in the WScript process, load the settings, and then assign the CFObject to a QTExporter belonging to QuickTime Player running in a different process. The QTExporter is unable to load the out-of-process CFObject that you've handed it, and fails with error code 0x80040201.

At 20:04 24/06/2006, Luc-Eric Rousseau wrote:
    var NewSettings =  WScript.CreateObject("QTOLibrary.CFObject.1");
    var xmlCodecInfoText = CodecFileInfo.ReadAll();
    NewSettings.XML = xmlCodecInfoText;
    qtExporter.Settings = NewSettings; // <<---- This Line Fails

A workaround involves using an existing Settings CFObject that belongs to the QuickTime Player process without having to create a new CFObject:

        var xmlCodecInfoText = CodecFileInfo.ReadAll();          
        var tempSettings = qtExporter.Settings; 
         tempSettings.XML = xmlCodecInfoText;    
         qtExporter.Settings = tempSettings;

This seems to work for me.

BTW, instead of:

try  {
    CodecFileInfo =  FileSystemObject.OpenTextFile( CodecInfoFileName );
}   catch(e)    {   } // exception is thrown if file not present

you can use:

if ( FileSystemObject.FileExists(CodecInfoFileName) )
{
        // read the file
}


Hope this helps,

John.


_________________________________________________________
John Cromie
Skylark Associates Ltd.             http://www.skylark.ie

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
QuickTime-API mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/quicktime-api/email@hidden

This email sent to email@hidden



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.