InvalidCastException - Different Max Versions - all Max.Net Versions

 
 
 
Posted by:Stylistics
Data created:14 January 2011

Hi,
the simple test works fine for me (Creating a basic tool) but all the other

samples produces the following errors:

System.InvalidCastException:
Das Objekt des Typs
"Autodesk.Max.Wrappers.ReferenceMaker"
kann nicht in Typ
"Autodesk.Max.IReferenceTarget"
umgewandelt werden.
bei
Autodesk.Max.Plugins.ReferenceTarget.NotifyDependents(IInterval changeInt, UIntPtr partID, RefMessage message, SClass_ID sclass, Boolean propagate, IReferenceTarget hTarg)
bei Autodesk.Max.Wrappers.ManagedWrapperReferenceMaker.NotifyDependents(ManagedWrapperReferenceMaker* , Interval changeInt, UInt32 partID, UInt32 message, UInt32 sclass, Int32 propagate, ReferenceTarget* hTarg)


System.InvalidCastException:
Das Objekt des Typs
"Autodesk.Max.Wrappers.ReferenceMaker"
kann nicht in Typ
"Autodesk.Max.IReferenceTarget"
umgewandelt werden.
bei
Autodesk.Max.Plugins.ReferenceTarget.GetInterface(IInterface_ID id)
bei Autodesk.Max.Wrappers.ManagedWrapperInterfaceServer.GetInterface(ManagedWrapperInterfaceServer* , Interface_ID* id)


It happens with all versions of the Max.Net SDK + different Visual Studio Versions + different 3D Max Versions + Different Net.Frameworks :-(

And the created MaxDotNetControl (Control Sample) has many NullReferences (Screenshots)

Anybody has an idea?


Attached Files:
Image 1

OS: Windows 7 32Bit

Max, VS 32Bit ;)

Hello,

I am not sure what exactly is wrong but it seems like its having trouble casting Refernce maker wrapper to its interface? Which version of Max have you tried this on?Something like would happen if there are multiple wrapper implementations loaded by Max, just a guess though.

Have you previously installed something like MaxSharp? Please make sure there is no Autodesk.Max.Wrappers.dll in your 3dsmax/bin/assemblies directory.

Marsel Khadiyev (Software Developer, EPHERE Inc.)

Can I assume that you're using Max 2009? I got this reproduced in that configuration.

Marsel Khadiyev (Software Developer, EPHERE Inc.)

Im tried Max 8.0 and 2009 ... doesnt Work in both Versions :-/

And tested it again in an Virtual Machine with a clean installation.

This issue should be resolved now. Please reinstall, however prior to doing that remove Autodesk.Max.dll so that its overwritten.

NOTE: This fix only applies to Max 2009 version

Thanks!

Marsel Khadiyev (Software Developer, EPHERE Inc.)