COM & NET integration

  • Thread starter Thread starter Michaelov, Itzik
  • Start date Start date
M

Michaelov, Itzik

Hello,
I created very simple DLL in C#.
I changed the above DLL COMVisible attribute to true ([assembly:
ComVisible(true)])
So a TLB file created.
Now i am using this DLL functionality from VB6.
All works fine.
The problem is when i set object to nothing in VB6, the .NET object
Finalize(~) method doesn't executed.
In this case i can't release public COM members of my .NET Classes.
I can't explicitly call to .Dispose from VB6.
Do you have any idea how resolve this problem ?

Thanks
 
Hello,
I created very simple DLL in C#.
I changed the above DLL COMVisible attribute to true ([assembly:
ComVisible(true)])
So a TLB file created.
Now i am using this DLL functionality from VB6.
All works fine.
The problem is when i set object to nothing in VB6, the .NET object
Finalize(~) method doesn't executed.
In this case i can't release public COM members of my .NET Classes.
I can't explicitly call to .Dispose from VB6.
Do you have any idea how resolve this problem ?

Thanks

Finalize is called during garbage collection, rather then when you
dispose of your object, and as such happens at some random time in the
future.
 
Back
Top