Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

File Open Dialog Box in ATL ActiveX Control

Posted on 2002-04-06
3
Medium Priority
?
423 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 1200 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…
IntroductionThis article is the second in a three part article series on the Visual Studio 2008 Debugger.  It provides tips in setting and using breakpoints. If not familiar with this debugger, you can find a basic introduction in the EE article loc…
The viewer will learn how to pass data into a function in C++. This is one step further in using functions. Instead of only printing text onto the console, the function will be able to perform calculations with argumentents given by the user.
The viewer will learn how to user default arguments when defining functions. This method of defining functions will be contrasted with the non-default-argument of defining functions.
Suggested Courses

722 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