Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Visual Basic > VB 6 Visual Basic 6 > Pro VB 6
|
Pro VB 6 For advanced Visual Basic coders working in version 6 (not .NET). Beginning-level questions will be redirected to other forums, including Beginning VB 6.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Pro VB 6 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old July 19th, 2004, 01:16 AM
Authorized User
 
Join Date: Jun 2003
Posts: 30
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to Dhodie
Default Instantiating Common Dialog Box

Hello!

Is there a way for me to use a common dialog
box inside a DLL? I tried instantiating the control and i noticed thati cannot create a NEW instance.

-Dhodie

 
Old July 19th, 2004, 04:00 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 231
Thanks: 0
Thanked 0 Times in 0 Posts
Default

You will have to add an invisible form to your ActiveX DLL project with a common diaolg box control on it, then in your DLL's class Set the common dialog box variable to the form.commonDialogBox control. Here is a very simple example
Code:
Dim WithEvents MyCommonDialog As CommonDialog

Private Sub Class_Initialize()
    Set MyCommonDialog = Form1.CommonDialog1
End Sub

Private Sub Class_Terminate()
    Set MyCommonDialog = Nothing
End Sub
I hope this helps.

Regards
Owain Williams
 
Old July 19th, 2004, 04:28 AM
Authorized User
 
Join Date: Jun 2003
Posts: 30
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to Dhodie
Default

Hi Owain!

Thanks for the reply!
Your codes work perfectly!

-Dhodie







Similar Threads
Thread Thread Starter Forum Replies Last Post
coding problem in common dialog box cancertropica Visual Basic 2005 Basics 0 July 30th, 2008 09:38 AM
Getting common dialog to work (re-install) Ragtime Access VBA 0 November 2nd, 2007 10:59 PM
How to use the flags int common dialog box diegoblin Beginning VB 6 2 November 8th, 2006 03:41 PM
Using common dialog with access azkabancells VB Databases Basics 2 May 14th, 2005 06:01 AM
Storing a file patch from a common dialog box marcin2k Access VBA 2 March 16th, 2005 03:58 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.