An enhanced DIBLOOK sample | CodeGuru

An enhanced DIBLOOK sample

This article describes a sample with the same funcionality as the known DIBLOOK MFC sample, but enhanced in some ways. The main (new) features of this new sample are: The sample is now completely object oriented, there are no global functions The standard file open dialog has been changed to a new (derived from standard) […]

Written By
CodeGuru Staff
CodeGuru Staff
Aug 1, 1998
1 minute read
CodeGuru content and product recommendations are editorially independent. We may make money when you click on links to our partners. Learn More

This article describes a sample with the same funcionality as the known DIBLOOK MFC sample, but enhanced in some ways. The main (new) features of this new sample are:



  • The sample is now completely object oriented, there are no global functions
  • The standard file open dialog has been changed to a new (derived from standard) file dialog with preview
  • The palette treatment has been improved so the palette is not realized twice for the active image (the first in foregroud the second in background)


The sample also demonstrates some programming techniques:



  • Changing the standard file open in doc/view MFC architecture
  • Modifiyng standard dialogs without using new hook functions (or what’s the same: using the MFC hook functions)
  • Correct palette treatment
  • Subclassing controls


Several new classes were added to the original DIBLOOK sample:



  • The dib api provided as a set of global functions was encapsulated in a CDib class (described in an article in the bitmaps & palettes section)
  • A static control descendant that displays an image (described in an article in the static control section)
  • A descendant from CFileDialog to implement the file open dialog with preview (described in an article in the dialogs section)
  • A descendant from CDocManager needed to change the default MFC file open dialog (described in an article in the doc-view section)


Download Source Code

Last updated: 25 June 1998

CodeGuru Logo

CodeGuru covers topics related to Microsoft-related software development, mobile development, database management, and web application programming. In addition to tutorials and how-tos that teach programmers how to code in Microsoft-related languages and frameworks like C# and .Net, we also publish articles on software development tools, the latest in developer news, and advice for project managers. Cloud services such as Microsoft Azure and database options including SQL Server and MSSQL are also frequently covered.

Property of TechnologyAdvice. © 2026 TechnologyAdvice. All Rights Reserved

Advertiser Disclosure: Some of the products that appear on this site are from companies from which TechnologyAdvice receives compensation. This compensation may impact how and where products appear on this site including, for example, the order in which they appear. TechnologyAdvice does not include all companies or all types of products available in the marketplace.