COM & NET integration

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
 
D

densial

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top