Making helper objects

 
 
 
Posted by:duke
Data created:15 April 2010

While playing around a bit more today, I found that I got an error when Max tried to load an abstract class:

namespace MaxDotNetX

{

    using System.ComponentModel;

    using Autodesk.Max;

 

    public abstract class PluginBase : IPlugin

    {

        public IGlobal Global { get; private set; }

        public IInterface Interface { get; set; }

        public IPluginView View { get; set; }

 

        public void Initialize(IGlobal global, ISynchronizeInvoke sync)

        {

            Global = global;

            Interface = global.COREInterface;

 

            InitializeView();

        }

 

        public abstract void InitializeView();

 

        public void Cleanup()

        {

            View.Close();

        }

    }

}

 

Good find, Max.NET doesn't check whether an IPlugin-derived class is abstract or not and tries to create an instance. I'll fix this for next build.

Marsel Khadiyev (Software Developer, EPHERE Inc.)