Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3348450
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T01:32:39+00:00 2026-05-18T01:32:39+00:00

Using code blocks or Dispose method hasn’t used in this MSDN example about dialog

  • 0

Using code blocks or Dispose method hasn’t used in this MSDN example about dialog boxes.

But why it is not disposed despite it has Dispose method ?

  • 1 1 Answer
  • 1 View
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-18T01:32:39+00:00Added an answer on May 18, 2026 at 1:32 am

    Hmya, that is not crystal clear unfortunately. OpenFileDialog and friends inherit Dispose() from the Component class. Every component must implement Dispose() because the Dispose() method of the form calls it. It just so happens to be that there are several Component derived classes that have a do-nothing Dispose() method. The dialog classes are like that, they are dialogs. They clean up any unmanaged resources when the dialog closes. No additional help is needed.

    This isn’t exactly documented well. It’s somewhat visible, the MSDN Library shows that the method was inherited, not overridden by the class. Which still doesn’t make it obvious that bypassing the inherited Component.Dispose() method is okay (it is). If you are uncomfortable with it, many programmers are, then don’t hesitate to wrap it with the using statement. It does no harm to call a Dispose() method that doesn’t do anything. Well, not the kind of harm you’d be ever be able to measure.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am using pseudo-code here, but this is in JavaScript. With the most efficient
I have been using code similar to this MessageDlg('', mtWarning, [mbOK], 0); throughout my
If I use object initializers in using-block I get Code Analysis warning about not
I'm using Code::Blocks to build my project, which contains three files: main.cpp , TimeSeries.cpp
As describe this article , about usage of using on IDisposable objects, it says
I'm using Code::Blocks for a project that uses templated classes, and I'm separating the
System Specs and task I am using Code::Blocks on Ubuntu 10.10 and playing around
Hello I'm trying to write some tool using code::blocks, wxWidgets and libxml2 on Windows
I am using SFML, and I am building an application in Code::Blocks and mingw32.
Using Vim I often want to replace a block of code with a block

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.