WIN32OLE -- missing sub-object members

Discussion in 'Ruby' started by djlewis, Dec 19, 2006.

  1. djlewis

    djlewis Guest

    I'm trying to connect to this set of Windows Scripting objects...

    http://www.dbpoweramp.com/developer-scripting-dmc.htm

    It seems to go OK for dMCScripting.Converter, but the other subobjects
    come up empty -- they are there, but I can't see or use any of the
    members. Here's code to show the problem...

    require 'win32ole'

    cnv = WIN32OLE::new("dMCScripting.Converter")
    mp3 = WIN32OLE::new("dMCScripting.Mp3Settings")
    ogg = WIN32OLE::new("dMCScripting.OggSettings")
    wav = WIN32OLE::new("dMCScripting.WaveSettings")
    wma = WIN32OLE::new("dMCScripting.WMASettings")

    p = Hash.new
    p[ :cnv] = cnv.ole_get_methods
    p[ :mp3] = mp3.ole_get_methods
    p[ :eek:gg] = ogg.ole_get_methods
    p[ :wav] = wav.ole_get_methods
    p[ :wma] = wma.ole_get_methods

    p.each do |k, v|
    printf( "%s, %d members\n", k, v.size)
    v.each {|x| printf( " %s\n", x.to_s)}
    end

    printf( "dMCScripting.Converters.VolumeNormalize = %d\n",
    cnv.VolumeNormalize)
    printf( "dMCScripting.Mp3Settings.Frequency = %d\n", mp3.Frequency)

    ------------------

    wav, 0 members
    wma, 0 members
    cnv, 7 members
    VolumeNormalize
    PreserveTags
    DeleteSourceFiles
    ConvertToFolder
    ToFolder
    GetCompressions
    WasConvError
    mp3, 0 members
    ogg, 0 members
    dMCScripting.Converters.VolumeNormalize = 0
    dbPowerAmp2.rb:24:in `method_missing': unknown property or method
    `Frequency' (WIN32OLERuntimeError)
    HRESULT error code:0x80020006
    Unknown name. from dbPowerAmp2.rb:24

    --------------------
    Accessing the dMCScripting object in VBA/Excel works fine, or at least,
    everything is present and accounted for in the object browser.

    I realize this could be a problem with the dMC dll (and I'll ask them
    too), but even if so, any help diagnosing that would be gratefully
    accepted. Of course, if I'm doing something wrong in ruby -- quite
    possible as I'm just starting with it -- I'd love to hear about that.

    Thanks. --David
     
    djlewis, Dec 19, 2006
    #1
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Replies:
    2
    Views:
    816
    Noah Roberts
    Jun 9, 2006
  2. Ben
    Replies:
    2
    Views:
    901
  3. Lawrence D'Oliveiro

    Death To Sub-Sub-Sub-Directories!

    Lawrence D'Oliveiro, May 5, 2011, in forum: Java
    Replies:
    92
    Views:
    2,044
    Lawrence D'Oliveiro
    May 20, 2011
  4. Masaki Suketa
    Replies:
    4
    Views:
    383
    Dave Burt
    Mar 27, 2006
  5. zxem
    Replies:
    1
    Views:
    237
Loading...

Share This Page