Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Common Dialog Initial Directory

Status
Not open for further replies.

jl280328

Programmer
Jun 15, 2006
97
US
I am trying to add the Microsoft Common Dialog component, but everytime I click ok I get an error that says
"Name Conflicts with existing module, project, or object library"

Is there any way to fix this, or is there any other way to set the initial directory of the common dialog when it opens up?
 
I just gound the GetSetting and SaveSetting methods and am trying to use them, but cannot get them to work for this. This is what I have so far
SaveSetting "DFEditor", "CommonDialog", "Cmndialog.InitDir", "C:/Work/UPF"
GetSetting "DFEditor", "CommonDialog", "Cmndialog.InitDir", "C:/Work/UPF"

but it isn't doing anything to the folder that the dialog opens up to?
 
Well you seem to be fixing your SaveSetting path with "C:/Work/UPF" so what's the point in using Save and Get Settings?

What you should do is before opening the CommonDialog use:
Commondialog.InitDir = GetSetting "DFEditor", NameofYourProg", "FilePath", App.Path

After closing the CommonDialog, use:
SaveSetting "DFEditor", "NameofYourProg", "FilePath", CurDir

[gray]Experience is something you don't get until just after you need it.[/gray]
 
I suspect it has already been registered. Best way to find out is to go in the registry and see if it's there, in hkey_classes_root. Do a search for the .ocx file name.

If it's already registered, you can use regsvr32.exe -u myfilename to unregister the old file, and then use regsvr32.exe again without the -u switch to register the new one.

HTH

Bob
 
Open your project's .vbp file with Notepad.

I suspect that you'll find the following line in it at the top:
[tt]
Reference=*\G{F9043C88-F6F2-101A-A3C9-08002B2F49FB}#1.2#0#..\..\..\..\WINNT\system32\COMDLG32.OCX#Microsoft Common Dialog Control 6.0 (SP6)[/tt]

Delete that line and save the changed file

Now reload your project in VB and you should find that you can add the Common Dialog Control without error

 
Ah... Misread the question completely!!!

[gray]Experience is something you don't get until just after you need it.[/gray]
 
Yes, I'm going to classify my answer as a "dumb" one, in light of strongm's nearly certainly correct one.
 
In my defence, I was answering the second question (I think) [ponder]

[gray]Experience is something you don't get until just after you need it.[/gray]
 
<In my defence

Resisting the urge to wax philosophical.....mightily resisting.....
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top