Hello again,
I’m having some difficulties implementing IRestoreObj. The examples I found in the SDK documentation don’t need to override all the methods I have (I guess this is because how the wrapper works). However, I’ve implemented all of the methods (maybe not correctly), but when I do this:
SelectionRestore test = new SelectionRestore(node, m_Global.Point3.Create(30,30,30));
IHold hold = m_Global.TheHold;
hold.Begin();
if (hold.Holding)
hold.Put(test); //Exception
I get a 'System.InvalidCastException' error: Unable to cast object of type 'AnimateTest.SelectionRestore' to type 'Autodesk.Max.IImplementable'.
public class SelectionRestore : IRestoreObj
{
//datamembers
public SelectionRestore(IINode node, IPoint3 undoValue)
{
//cut because of space
}
public string Description
{get { return "Undo Movement of node"; }}
public void EndHold()
{ }
public IntPtr Execute(int cmd, UIntPtr arg1, UIntPtr arg2, UIntPtr arg3)
{return new IntPtr(-1);}
public void Redo()
{
//cut because of space
}
public void Restore(bool isUndo)
{
//cut because of space
}
public int Size
{get { return 1; }}
public IBaseInterface GetInterface(IInterface_ID id)
{return null;}
public bool Equals(IInterfaceServer other)
{return Equals(other);}
public void Dispose()
{ }
public IntPtr Handle
{get { return new IntPtr(-1); }}
}
Any idea what I could do?
Thanks in advance,
Vin