|
-
Aug 6th, 2006, 09:37 PM
#1
Thread Starter
Frenzied Member
[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.
-
Aug 6th, 2006, 10:14 PM
#2
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.
-
Aug 6th, 2006, 10:26 PM
#3
Thread Starter
Frenzied Member
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.
-
Aug 6th, 2006, 10:31 PM
#4
Thread Starter
Frenzied Member
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|