Solved

File Open Dialog Box in ATL ActiveX Control

Posted on 2002-04-06
3
404 Views
Last Modified: 2010-08-05
Hi All...

I'm developing an ActiveX control in ATL. It has a property called "FileName". I would like to bring up the file open dialog box when the user clicks that "FileName" property in VB. I mean when the user clicks the "..." button.

Pls help me!!!


Rgds
Jagadeesh
0
Comment
Question by:coxswain
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 22

Accepted Solution

by:
ambience earned 300 total points
ID: 6941164
In your handler for "..." open the file dialog

TCHAR filename [ MAX_PATH ];
filename[0] = 0;

OPENFILENAME fn;
ZeroMemory(&fn, sizeof fn);
fn.lStructSize = sizeof(fn); // for Win 2000
fn.lStructSize = OPENFILENAME_SIZE_VERSION_400 ; // for Win 9x, NT
fn.lpstrFilter = _T("Text Files\0*.txt\0\0");
fn.lpstrFile = filename;
fn.Flags = OFN_FILEMUSTEXIST | OFN_NOCHANGEDIR;

if(GetOpenFileName(&fn))
{
   // filename  now has file selected by user.
}

hope this helps
0
 
LVL 11

Expert Comment

by:griessh
ID: 6957242
Dear coxswain

I think you forgot this question. I will ask Community Support to close it unless you finalize it within 7 days. You can always request to keep this question open. But remember, experts can only help you if you provide feedback to their questions.
Unless there is objection or further activity,  I will suggest to accept

     "ambience"

comment(s) as an answer.

If you think your question was not answered at all, you can post a request in Community support (please include this link) to refund your points. The link to the Community Support area is: http://www.experts-exchange.com/commspt/

PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!
======
Werner
0
 
LVL 6

Expert Comment

by:Mindphaser
ID: 6979192
Force accepted

** Mindphaser - Community Support Moderator **
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article will show you some of the more useful Standard Template Library (STL) algorithms through the use of working examples.  You will learn about how these algorithms fit into the STL architecture, how they work with STL containers, and why t…
Go is an acronym of golang, is a programming language developed Google in 2007. Go is a new language that is mostly in the C family, with significant input from Pascal/Modula/Oberon family. Hence Go arisen as low-level language with fast compilation…
The goal of the video will be to teach the user the concept of local variables and scope. An example of a locally defined variable will be given as well as an explanation of what scope is in C++. The local variable and concept of scope will be relat…
The viewer will be introduced to the technique of using vectors in C++. The video will cover how to define a vector, store values in the vector and retrieve data from the values stored in the vector.

733 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