Itunes COM SDK: cannot register function with iTunes Outgoing Interface

I am doing benchmarks and I want to time the encoding of a Music CD. In order to stop the "clock" and compute the time I am trying to bind a function with the _IITConvertOperationStatusEvents::OnConvertOperationCompleteEvent()
I am writing a AutoIt script and I can create the iTunes application object but when I use the ObjEvent function to register my function with the event above it causes a COM exception to be raised and the ObjEvent completes with an error. The exception code I get is 80040200 which seems to be a generic error.
$objApp=ObjCreate("iTunes.Application")
$SinkObject=ObjEvent($objApp, "ITEvent", "_IITConvertOperationStatusEvents")
<<exception 80040200>>
Browsing the iTunes COM TypeLib the _IITConvertOperationStatus does not seem to be a child in the iTunes object hierarchy so I think this is way the exception is being raised. I have tried to register another function with another outgoing interface and this works just perfectly: _IiTunesEvents::OnQuitting()
Do I need to create another object which gets passed as the first parameter to the ObjEvent function?
*Here is the entire script:*
$ITSourceKindAudioCD = 3
$begin = 0
Global $trackName, $progressValue, $maxProgressValue, $SinkObject
$oMyError = ObjEvent("AutoIt.Error","MyErrFunc") ; Install a custom error handler
$objApp = ObjCreate("iTunes.Application")
If @error Then
MsgBox(0, "ObjCreate", "Create Object Failed", 3)
Exit
EndIf
$event = ObjEvent($objApp, "ITEvent1_", "_IiTunesEvents")
If @error Then
MsgBox(0, "Failed", "IiTunesEvent binding failed", 5)
Exit
EndIf
$SinkObject = ObjEvent($objApp, "ITEvent_", "_IITConvertOperationStatusEvents") ; Assign events to UDFs starting with IEEvent_
If @error Then
MsgBox(0, "ObjEvent binding", "ObjEvent failed!", 10)
$objApp.Quit()
Exit
EndIf
$colSources = $objApp.Sources
$begin = TimerInit()
For $objSource in $colSources
If $objSource.Kind = $ITSourceKindAudioCD Then
$strName = $objSource.Name
$colPlaylists = $objSource.Playlists
$objPlaylist = $colPlaylists.ItemByName($strName)
$colTracks = $objPlaylist.Tracks
$objApp.ConvertTracks2($colTracks)
EndIf
Next
Do
; Wait around for the ripping to complete
Until False
; This is my custom error handler
Func MyErrFunc()
$HexNumber = hex($oMyError.number,8)
Msgbox(0,"","We intercepted a COM Error !" & @CRLF & _
"Number is: " & $HexNumber & @CRLF & _
"Windescription is: " & $oMyError.windescription )
EndFunc
Func ITEvent1_OnQuittingEvent()
MsgBox(0, "Bye", "Bye-Bye", 10)
EndFunc
func ITEvent_OnConvertOperationCompleteEvent()
$dif = TimerDiff($begin)
MsgBox(0,"Time Difference",$dif)
$objApp.Quit()
EndFunc

much of this is speculation because I can't remember how many previous versions of iTunes were on these machines...but this is what we're seeing:
extra entries in two registry keys... when it didn't work these two registry entries contained "AppID" values:
HKEYCLASSESROOT\CLSID\{B9E1D2CB-CCFF-4AA6-9579-D7A4754030EF}\Implemented
Categories
HKEYLOCALMACHINE\SOFTWARE\Classes\CLSID\{B9E1D2CB-CCFF-4AA6-9579-D7A4754030EF}
with the APpID set to the same iTunes CLSID string:
{B9E1D2CB-CCFF-4AA6-9579-D7A4754030EF}
and when it did work the AppIDs entries were gone. this is only on XP.
on vista there never was any AppID entry.
but, again, i wonder if that was added by previous versions of iTunes which we didn't install on the vista machines...
Also, worthy of noting is this post from Apple:
http://support.apple.com/kb/HT1925
ciao, raza

Similar Messages

  • ITunes COM SDK to sync Audiobook with iOS 5 issue

    My application has been using iTunes COM SDK for Windows to add tracks into iOS devices and it's been working for years. Until the recently released iTunes 10.5 versus iOS 5, the added tracks are missing from the iOS 5 devices (iPhone, iPad, etc.).
    The SDK calls are returned successfully and from desktop, the iTunes 10.5 shows the tracks under "Books" folder of iOS 5 device correctly. I can also play it form desktop. But, from the iOS 5 device, the track is totally missing!!! However, if I perform a search in the device with the track name, then I can find it and play it. It just does not list under the Audiobooks folder of the device!
    If I used the same SDK calls to add to "Music" folder, then it works fine.
    Any idea? I suspect it is a bug either in iTunes 10.5 or iOS 5? Because apparently the audio track is there, iTunes 10.5 sees it, but the iOS 5 can't?
    Please help.
    Thanks.

    Thanks for the reply. The functions from iTunes COM SDK are straightforward. Find the IITIPodSource to the connected device and then obtain its IITLibraryPlaylist interface to call AddFile() or AddTrack() depends on whether the audio file is from file system or from iTunes Library. The trick for the audio file to be categorized in Audiobooks is to use ".m4b" file extension for AAC encoded format.
    It has been working for earlier iTunes versus iOS 4 and under, and it is still working, the file still shows up in iTunes > iOS 5 device > Books. However, the iOS 5 device's Music app does not pick it up. I found that if I tried to use ".m4a" then the iOS 5 device will pick it up under "Songs" (or "Music" under iTunes).
    I think either the AddTrack() or AddFile() calls have bugs or the iOS 5 Music app has glitch that cannot pickup certain files added into device. I've submitted bugs to http://bugreport.apple.com, at the same time, maybe someone from the community has idea to work around this?

  • How to use iTunes COM SDK to set Media Kind for tracks

    There is no obvious function to set Media Kind of a track from iTunes COM SDK. Just curious if anyone knows how to do it programmatically?

    AFAICT there isn't a way to do it via the COM SDK. I currently do it by simulating window events using AutoIT.
    File a bug report as an enhancement request if you want it:
    https://bugreport.apple.com
    You'll need an ADC account; "ADC Online" accounts are free:
    http://developer.apple.com/products/membership.html

  • ITune COM SDK supports GUI access?

    I am searching for  API to log-in to iTune with Apple ID and Password.
    I have  Apple ID and Passwords written in an excel file.
    What I want to do is to:
    Read the excel file line by line to take ID/PASS
    Log-in to iTunes with that ID/PASS
    Click the download button
    Is there any  library for this purpose (For step #2 and  #3)? Does iTunes COM SDK support that GUI (input in to the ID - PASSWORD field) access?
    This is urgent for me.
    Please anyone help.
    Thanks in Advance
    Rahman

    It seems that it is reading something in the ObAccessClient.xml file, because it receives a response from the Access Server. I would guess some sort of communications error - perhaps a certificate error if Open transport mode is not being used. Also, are the times on the asdk machine and the Access Server in sync?
    Regards,
    Colin

  • ITunes COM SDK License Warning

    Hi,
       I'm developing a commercial app that works with the iTunes COM SDK. However, on the download page for the SDK, there's this warning:
    Warning: Pre–release software is Apple confidential information. Your unauthorized distribution of pre–release software or disclosure of information relating to pre–release software (including the posting of screen shots) may subject you to both civil and criminal liability and result in immediate termination of your ADC Membership.
    I know this download is a few years old and, presumably, so is the message. However, since that's not made clear anywhere on the page, can I still use this SDK for commercial purposes or would it be considered as 'unauthorized distribution' since I have to include the DLL with my app? (As a side note, this message doesn't appear on all downloads,so it's not just a generic one).
    Thanks

    No, not sure how you've drawn the conclusion I'm just confirming that I've understood the warning message correct and that the SDK being released, whether in source or binary form, actually counts as 'unauthorized distribution'. I'm new to Apple SDKs, so I'm unfamiliar with how things like this work here. Seeing how widespread the iTunes COM tutorials are, I thought I might've misunderstood something regarding the warning. So, essentially, you're saying the answer to my question is no, it can't be used for commercial purposes. Correct?

  • My Media Keys are not functioning with iTunes 10.6.1...

    My Media Keys are not functioning with iTunes 10.6.1... As i said
    Keyboard: Microsoft Digital Media Keyboard 3000
    I've actually had this issue since like what, 10.4? I've tried that dll fix thing and that does nothing. Any help out there so I can play my music without having to leave the micro player popped up all the time?

    And included on the retail sales box.
    http://www.apple.com/iphone/specs.html
    Syncing with iTunes on a Mac or PC requires:
    Mac: OS X v10.6.8 or later
    PC: Windows 7; Windows Vista; or Windows XP Home or Professional with Service Pack 3 or later
    iTunes 10.7 or later (free download from www.itunes.com/download)

  • Can not sync ipod shuffle says : The Ipod SYS  cannot be used with itunes  because it is not formatted properly. But i have restore it several times and still not working

    Hi, I'm trying to sync my new Ipod to get the new album I got but when I connected it the meesage: The Ipod SYS  cannot be used with itunes  because it is not formatted properly. appears in itunes. I have restored several times now but it is not working I already downloaded music to it, it is brand new..just 2 weeks old. Somebody can help me? Do I need to return it to the store I bought it from?

    The last Restore completed without any error message, or do you get the "ipod SYS" error message?
    I'm thinking this is a case of iTunes and Windows confusing the iPod's storage disk with another drive, described here
    http://support.apple.com/kb/ts1493
    So, iTunes/Windows thinks another drive is the iPod, and errors out because that drive is not formatted as expected (for an iPod).  The solution, in the document linked above, is to change the iPod's assigned drive letter.

  • ITunes COM SDK broken on Windows XP??

    I have an application called TuneUp Companion (http://www.tuneupmedia.com) that was working fine with iTunes 7.7 and after upgrading is broken.
    It works fine on Windows Vista ...but iTunes 8 on Windows XP seems to give a message back that the iTunes COM interface is not available.
    Are there known issues with the iTunes COM SDK for Windows (7/15/08 release) on Windows XP??
    Thanks, Raza

    much of this is speculation because I can't remember how many previous versions of iTunes were on these machines...but this is what we're seeing:
    extra entries in two registry keys... when it didn't work these two registry entries contained "AppID" values:
    HKEYCLASSESROOT\CLSID\{B9E1D2CB-CCFF-4AA6-9579-D7A4754030EF}\Implemented
    Categories
    HKEYLOCALMACHINE\SOFTWARE\Classes\CLSID\{B9E1D2CB-CCFF-4AA6-9579-D7A4754030EF}
    with the APpID set to the same iTunes CLSID string:
    {B9E1D2CB-CCFF-4AA6-9579-D7A4754030EF}
    and when it did work the AppIDs entries were gone. this is only on XP.
    on vista there never was any AppID entry.
    but, again, i wonder if that was added by previous versions of iTunes which we didn't install on the vista machines...
    Also, worthy of noting is this post from Apple:
    http://support.apple.com/kb/HT1925
    ciao, raza

  • Error with iTunes "The iPod Group Storage cannot be used with iTunes...."

    I bought a usb hub to accomodate my multiple usb devices. I plugged my iPod into this and got the following error:
    "The iPod Group Storage cannot be used with iTunes because it is not formatted properly."
    I plugged the iPod into the computer rather than the hub. Same thing
    Tried to restore, per the error message's direction. It says it has restored it to factory settings, then it brings up that message again.
    I uninstalled and re-installed iTunes. Same thing. It was playing fine but it needs re-charging now and it won't because of the error.
    Does anyone have any ideas? I don't know what to do now.
    Thanks.

    Try to reset your iPod using the recovery mode as described in this support article
    However, this will erase the iPod completely. If you have an iTunes-backup on your computer you can restore your iPod settings later from the backup.
    I have never tried this in WIndows, however. The procedure might be slightly differeent.

  • Where did the iTunes COM SDK go?

    I was going to go download the iTunes COM SDK, originally at http://developer.apple.com/sdk/, but it appears that when you click on the link to get it, it redirects you to the ADC site... which doesn't have the iTunes COM SDK anywhere in there. Does anyone know where it went?

    You now need to have an ADC membership to download the SDKs. You can sign up for the free Online Developer membership here:
    http://developer.apple.com/products/membership.html

  • I have the new iOS 6 on my iPad, and when ever I try to log on to the iTunes store this comes up: Cannot connect to the iTunes store. Anybody help please? :)

    I have the new iOS 6 on my iPad, and when ever I try to log on to the iTunes store this comes up: Cannot connect to the iTunes store. Anybody help please?

    I'm also having this problem I've already tried changing the year stuff and its still the same I succeeded once when I toggled my credit card account but after that the same problem occurred.

  • Everytime I try to download a song purchase from itunes I get the error message. 'Unable to Download Song' could not be downloaded at this time. I cannot even sync with itunes on the PC.

    Hi guys,
    I need some everytime I try to download a song purchase from itunes I get the error message. 'Unable to Download Song' could not be downloaded at this time. I cannot even sync with itunes on the PC.
    Kind regards
    Ian

    One correction, from the icloud I was not able to listed to the entire song.  So when you purchased the song if it wasn't downloaded to your library, chances are you have lost your opportunity to listen to it.

  • Won't register iPod with iTunes

    Ok, so I've had my 80g classic for over a week, and I have yet to register it with iTunes successfully. I go through all the steps, and then get an error message saying and I quote "we could not complete your iTunes store request.The requested resource was not found. There was an error in the iTunes store. Please try again later." So, am I doing something wrong? I have an old school shuffle already registered. I'm trying to register the new one with the same account, is that the problem?

    You don't actually need to register an iPod to use it with your computer or iTunes store account. Check the never register box and you can register from the registration web page some other time: Apple Product Registration

  • Cannot sync ipod with itunes after setting up new computer with newest version of itunes

    Cannot sync ipod with itunes after setting up on new computer, only songs which tansferred were songs bought on new computer after set up, tried to sync songs and it deleted old songs from ipod.  How can I get them back on ipod??  They are showing in music library on itunes still.

    If the iPod database gets corrupted, it will add files to "Other" instead of where they really belong.
    Restoring the iPod will erase this database and recreate it.
    And if I do this, won't I just have the same issue when my iPod is re-updated to the most recent version again?
    No, it shouldn't. This is why you Restore the iPod. It erases the corrupt database.

  • My hard drive went and when i got my computer back from being fixed my itunes had been deleted, so i re installed it however my ipad wont connect to the itunes as its not registered to this itune, also all my songs arent on here what do i do?

    My hard drive went and when i got my computer back from being fixed my itunes had been deleted, so i re installed it however my ipad wont connect to the itunes as its not registered to this itune, also all my songs arent on here what do i do?

    There is no such thing as an "SG3" or "SG4".  Did you possibly mean a 3GS and iPhone4?
    It has always been very basic to ensure that a backup exists of your media and other important files.  Computers fail, hard drives crashes... things happen.  Do you not have a backup?  The iPhone, like all iDevices is NOT a backup of your media, but rather a mirror of the content in the iTunes library on your computer.
    If your contacts, pics, etc are not on your computer, no backups of the iPhone exist, and they are not on the phone, they are gone.
    No one can magically make them re-appear.

Maybe you are looking for

  • Sending email to multiple address using Utl_Smtp

    Hi, I want to send email to multiple address using the Utl_Smtp feature. When I am sending email to one email address in the To:Field it works fine.However, when I send to multiple address I am getting the below error.I am using a table(Email_test) t

  • What port type should i use?

    I am using Seebeyond as middleware and it sending Vehicle IDoc VEHCLE01 to SAP System. Please help me what should port type I need to use? Should it be file port or t-rfc port? What should partner type need to use? Can it be LS type? Is it ALE or EDI

  • Can't install iPod updater or Quick Time

    If I try install iPod updater I get error message: "-1608: Unable to Create InstallDriver Instance" or "-1607: Unable to Install InstallShield Scripting Run Time" What Can I do? I have tested http://support.microsoft.com/default.aspx?scid=kb;en-us;88

  • Missing Third Party App Icon

    I've recently noticed that an app, in this case Shazam Encore, is missing. I'm not sure when it went missing so I'm not sure what caused it to happen. I've searched everywhere I can think of for ideas of how to fix it but can't find anything that wor

  • Copy Actuals to Plan

    Dear All, now i tried since 2 days to copy the actauls of CO-PA into a new plan version using KEPM. In general i would like to copy the actuals 2011 (january to August) to Planverion VS2. Could some one help me? br Andre