P
Peter Proost
Hi group,
Here at work they've got an activeX control which is used on a usercontrol,
and this usercontrol is one of the standard controls in the framework, so
this user controls get's used a lot on other usercontrols or windows forms.
But the problem is the activex control doesn't get disposed. (profiled the
app with scitech .net memory profiler 2.5) I added this code to disposing
event of the base usercontrol (the one in the framework which contains the
activeX):
'Grid is the name of the activeX control
'Toegevoeg door Peter 31/03/2005
If Not Grid Is Nothing Then
Grid.Dispose()
End If
'einde toevoeging
but that doesn't help, I also tried it in the usercontrol's finalize method
but also no success. But if I create a sub in the usercontrol:
Public sub MyDispose
If Not Grid Is Nothing Then
Grid.Dispose()
End If
End sub
and then in the form's closing event of the form that hosts the usercontrol
call
myusercontrol.Mydispose
the activex control get's disposed and releases it's memory.
But now my question is isn't there a way so I can dispose the activeX
control on the usercontrol from within the user control without the extra
sub.
Greetz Peter
Here at work they've got an activeX control which is used on a usercontrol,
and this usercontrol is one of the standard controls in the framework, so
this user controls get's used a lot on other usercontrols or windows forms.
But the problem is the activex control doesn't get disposed. (profiled the
app with scitech .net memory profiler 2.5) I added this code to disposing
event of the base usercontrol (the one in the framework which contains the
activeX):
'Grid is the name of the activeX control
'Toegevoeg door Peter 31/03/2005
If Not Grid Is Nothing Then
Grid.Dispose()
End If
'einde toevoeging
but that doesn't help, I also tried it in the usercontrol's finalize method
but also no success. But if I create a sub in the usercontrol:
Public sub MyDispose
If Not Grid Is Nothing Then
Grid.Dispose()
End If
End sub
and then in the form's closing event of the form that hosts the usercontrol
call
myusercontrol.Mydispose
the activex control get's disposed and releases it's memory.
But now my question is isn't there a way so I can dispose the activeX
control on the usercontrol from within the user control without the extra
sub.
Greetz Peter