The new vbAccelerator Site - more VB and .NET Code and Controls
Source Code
3 Code Libraries &nbsp

Two code only solutions for displaying Common/Dialogs

Reuse the CommonDialog/Direct code directly in your application and ditch dependencies

NOTE: this code has been superceded by the version at the new site.

More Common Dialogs...

Download Code
VB5 codeVB6 code Download the Simple Single Exe Sample (24kb)
VB5 codeVB6 code Download the Full Function Single Exe Sample (23kb)

The Common Dialog/Direct component provides you with a more functional version of the Common Dialog control which also means you no longer need a form to create Common Dialogs. These samples show how you can go one further with your app and remove the need to ship any DLLs at all!

The Harder They Come
There are two ways to do this: the "minimum code" way and the "full compatibility" version. The minimum code solution means you just need one class in your application: but you loose the ability to use Hooks to centre and customise dialogs and you get a simplified interface to work with. The full compatibility version, on the other hand, means you need to add three classes and one module to your application, but it provides 100% of the functions provided by the DLL.

I'll cover these in turn.

The Minimum Code Way
In this version code is combined from various parts of the CommonDialog/Direct DLL and the support for Hooks and Templates removed. The result is a single class cCommonDialog.bas which offers the following functions:

These functions are equivalent to the Show.. methods of the Common Dialog but with all the properties supplied as parameters rather than being individually set through properties.

The Minimum Code Single Exe Demonstration project demonstrates opening and saving a document using this method.

The Full Compatibility Way
This method simply involves copying all the code from the CommonDialog/Direct library into a project, and ignoring any error messages from VB "Class xxx cannot be public in this type of project, type changed to private". The Full Function Single Exe Demonstration above shows a sample which uses a hook to centre a File Open Dialog box.

TopBack to top
Source Code - What We're About!Back to Code Libraries
Source Code - What We're About!Back to Source Code Overview


AboutContributeSend FeedbackPrivacy

Copyright 1998-2000, Steve McMahon ( All Rights Reserved.
Last updated: 21 March 2000