Problem Solving for ComboBox and Garbage Collector


#1

Problem Solving with dotNetObject “System.Windows.Forms.ComboBox” for 2009 3dsMax
As is well known “ComboBox” conflicts with 3dsMax Garbage Collector
In 2010 3dsMax and above is solved by using next function:

 AssemblyComboBox = dotNetObject "System.Windows.Forms.ComboBox" 
dotNet.setLifetimeControl AssemblyComboBox # dotnet

For 3dsMax 2009 (and I think this will work and with 3dsMax 9 )
problem can be solved in this way
Protecting the object from garbage collection

 (dotnetclass "System.gc").SuppressFinalize AssemblyComboBox 
(Dotnetclass "System.gc").KeepAlive AssemblyComboBox 

when closing the form allow the garbage collector process combo box

 (dotnetclass "System.gc").ReRegisterForFinalize AssemblyComboBox 
AssemblyComboBox.Dispose() 

.Net System.GC


#2

This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.