Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

I recently upgraded my application from Visual Basic 6 to Visual Basic .NET.

 

I have a ADODB Command Object. In Visual Basic 6, I was able to destroy this object saying, Set obj = Nothing

 

But .NET uses garbage collection and I am not able to use Nothing. I can't wait till the object is garbage collected as I have to initilize it and use it for someother purpose.

 

I came across the 'dispose()' method. But this works only for VB components and not for ActiveX objects.

 

Can anybody help me with this please?.

 

Thanks,

Muthuraman

  • *Experts*
Posted
I think that as soon as the sub finishes that the object is declared finished, the object will go out of scope, and .NET's COM interop will handle the freeing of the COM object. I don't think there is any function to need to worry about to free the memory.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...