Solved

How do I call the "Open file dialog box" api in VB6

Posted on 1999-01-14
4
896 Views
Last Modified: 2008-03-10
All (well almost) program under Win95-98 uses the same openfile dialogbox API
how do I call this API with VB6
0
Comment
Question by:Lazypete
  • 2
4 Comments
 
LVL 1

Author Comment

by:Lazypete
Comment Utility
If u need info about my question... fell free to ask
lazypete@total.net
0
 
LVL 69

Accepted Solution

by:
Éric Moreau earned 180 total points
Comment Utility
Do you really want to use API commands or you accept an easier substitute?

Here what I have to proposed (and you will have the standard dialog box). In fact, it is an OCX that calls those APIs.

Add the Microsoft Common Dialog Control to your project, place an instance on a form, also place a command button on this form and paste this code:
Private Sub Command1_Click()
    CommonDialog1.ShowOpen
    MsgBox CommonDialog1.FileName
End Sub

You cannot have a simplest solution.
0
 
LVL 10

Expert Comment

by:caraf_g
Comment Utility
Pete,

emoreau's answer is far better than using any API calls. Use the common dialog control - and look at the help because there is an awful lot you can do with it to make it work exactly the way you want it to - especially look into how it can deal with long filenames and so on.
0
 
LVL 1

Author Comment

by:Lazypete
Comment Utility
Exactly what I wanted..
Thanx a lot..
0

Featured Post

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

Suggested Solutions

Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

771 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now