. Net calls VB6 to write the syntax of component [release resource]

Source: Internet
Author: User
In writing . Net When, . Net Resources will not be recycled automatically. Therefore, after calling the component, you need to clear the resources by yourself.
If you call . Net Written COM + Component, the Resource Recycling syntax is

obj. dispose () OBJ = nothing

However, if you call VB6 Cannot call Dispose Release resources
Therefore, you need to use the following commands to release the resource. ( The number in the component service stops. )

System. runtime. interopservices. Marshal. releasecomobject (OBJ)

The overall syntax is as follows:

Dim OBJ As   Object   =   Createobject ("Pdemo. cdemo ")
Try

Catch Ex As Exception

Finally

System. runtime. interopservices. Marshal. releasecomobject (OBJ)
OBJ =   Nothing

End   Try

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.