Results 1 to 4 of 4

Thread: [2.0] Explicit or Implicit

  1. #1

    Thread Starter
    Frenzied Member mar_zim's Avatar
    Join Date
    Feb 2004
    Location
    Toledo Cebu City.
    Posts
    1,416

    [2.0] Explicit or Implicit

    I have an application that using WMI classes my question goes is it advisable to call a dispose method explicitly and does WMI classes used unmanaged resources that I must call a dispose method to free up unmanaged resources?




    Thanks in advance.

  2. #2
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,221

    Re: [2.0] Explicit or Implicit

    You should always explicitly call Dispose on any object that supports it when you have finished with that object. When you say that you are using WMI classes, have you used mgmtclassgen.exe to generate strongly-typed classes or are accessing every WMI class through an instance of the ManagementObject class? Either way you should be explicitly disposing your objects, but if you're using WMI a lot then I'd suggest using strong-typing.
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

  3. #3

    Thread Starter
    Frenzied Member mar_zim's Avatar
    Join Date
    Feb 2004
    Location
    Toledo Cebu City.
    Posts
    1,416

    Re: [2.0] Explicit or Implicit

    Yeah I'm just accessing each class under the instance of management object.
    Could you give me some link about strong-typing or about the mgmtclassgen.exe?

    btw thanks for the reply mate.

  4. #4

    Thread Starter
    Frenzied Member mar_zim's Avatar
    Join Date
    Feb 2004
    Location
    Toledo Cebu City.
    Posts
    1,416

    Re: [2.0] Explicit or Implicit

    ok I already google it and found some interesting article.
    Thanks.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width