local assembly = (dotnetclass "System.Reflection.Assembly").Load ((dotnetclass "System.IO.File").ReadAllBytes "c:\\myDll.dll")
local type = assembly.GetType "myNameSpace.myClass"
local classInstance = (dotNetClass "activator").CreateInstance type
Now i just need to figure out how to use it with dotNetControls.
let’s start from the end of you post… the loading of DLL (assembly) as bytes array allows you to override the DLL because the DLL (as file) is not captured by MAX. That’s the goal. It makes debugging process much easier. My code above creates new assembly and you can use CreateInstance method to create a class from this assembly.
So it has to go as:
my_assemby = (see code above)
my_class = my_assembly.CreateInstance "MyClass"
after that you can use any method from the class…
you can create you own object from of your class (or any type defined in the class) but not a dotnetcontrol. Dotnetcontrol is not really .NET object, it makes sense in MAX only. Dotnetcontrol is MAX Script UI control wrapper and it uses .net object from first loaded assembly. So you can load your assembly using byte method and can create dotnetcontrol but only from assembly that was loaded first.
And dot net controls. IS there any known problems with this approach?
I will start to try some things, and read further into the information presented on t’web but just in case I am on a massive wild goose chase, please feel free to give me any info to stop me in my tracks!
that’s right. i do the same. but… why the assembly can be loaded right without the fullpath? of course i don’t have any problem to use dll compiled in the vstudio. that means MAX fully supports .net 3.5. i’m really puzzled.