INTERACT FORUM

Please login or register.

Login with username, password and session length
Advanced search  
Pages: [1]   Go Down

Author Topic: Bug in MJAutomation.CreateFiles()  (Read 1975 times)

Doof

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 5908
  • Farm Animal Stupid
Bug in MJAutomation.CreateFiles()
« on: May 08, 2006, 10:09:56 am »

I've been running into a problem using the CreateFiles() function.

Basically, once it's been invoked by a plugin, going to Playing Now (or even any View Scheme) causes MC to crash if CreateFiles is invoked again. This happens even across plugins.

The plugin is set to PluginMode 0, so it doesn't run all the time. If it's set to PluginMode 1, this doesn't happen.

To test this, I created a plugin that does nothing but call this function. The first time it's run, everything's fine. Then you jump to Playing Now, then back to the plugin and you get the follow message: "Unspecified error (Exception from HRESULT : 0x80004005 (E_FAIL))"

So either, I'm using it incorrectly, or it's a bug? Any chance one of you JRiver guys could shed some light on this?

Like I said, if I set the PluginMode to 1, then this problem goes away, but then the plugin behavior isn't really ideal. It would be workable, though, if I could figure out what events are triggered when you navigate away from a plugin or exit it altogether.
Logged

Doof

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 5908
  • Farm Animal Stupid
Re: Bug in MJAutomation.CreateFiles()
« Reply #1 on: May 08, 2006, 10:12:34 am »

Here's the source code I used in my test plugin:

Code: [Select]
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Text;
using System.Windows.Forms;

namespace MC_CSPlugin
{
    [System.Runtime.InteropServices.ProgId ( "Template_MCPlugin.CSTemplate" )]

    public partial class MainInterface : UserControl
    {
        private MediaJukebox.MJAutomation mediaCenterReference;
        private MediaJukebox.MJFilesAutomation filesReference;

        public MainInterface ( )
        {
            InitializeComponent ( );
        }

        public void Init(object mediaCenterRef)
        {
            this.mediaCenterReference = (MediaJukebox.MJAutomation)mediaCenterRef;
            MessageBox.Show("Calling CreateFiles()");
            this.filesReference = mediaCenterReference.CreateFiles();
        }
    }
}
Logged

Mr ChriZ

  • Citizen of the Universe
  • *****
  • Posts: 4375
  • :-D
Re: Bug in MJAutomation.CreateFiles()
« Reply #2 on: May 08, 2006, 11:24:19 am »

Doof, out of curiosity does it still do it if you move the
CreateFiles behind say something like a button press?
(Out of Init)

Doof

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 5908
  • Farm Animal Stupid
Re: Bug in MJAutomation.CreateFiles()
« Reply #3 on: May 08, 2006, 11:56:29 am »

Well, in my actual plugin, it was being called from a combobox SelectedIndexChanged event handler.

I put it in the Init of the test plugin just to demonstrate that there was nothing else going on except the call to CreateFiles.
Logged

Doof

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 5908
  • Farm Animal Stupid
Re: Bug in MJAutomation.CreateFiles()
« Reply #4 on: May 11, 2006, 11:49:26 am »

*bump*

Also.. I have a general question about CreateFiles().

What is it supposed to do?

I inferred from this text from the SDK:

MJFilesAutomation * CreateFiles()

Description: gets a MJFilesAutomation interface (see below) containing all files
Return Value: MJFilesAutomation interface

That CreateFiles was supposed to give us an MJFilesAutmation interface representing all files in the library. Instead it just seems to be giving it to me empty. So is it supposed to return it empty, in which case, what's meant by "containing all files", or is it supposed to return all files, in which case, why isn't it?
Logged

John Gateley

  • Citizen of the Universe
  • *****
  • Posts: 4957
  • Nice haircut
Re: Bug in MJAutomation.CreateFiles()
« Reply #5 on: May 11, 2006, 12:35:06 pm »

The doc is wrong, I'll fix it. It returns an empty set of files.

j

Doof

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 5908
  • Farm Animal Stupid
Re: Bug in MJAutomation.CreateFiles()
« Reply #6 on: May 11, 2006, 01:19:46 pm »

Any way of getting all of the files? I looked through the SDK and I didn't see any way to guarantee a list of all fles.
Logged
Pages: [1]   Go Up