Solved

File Open Dialog Box in ATL ActiveX Control

Posted on 2002-04-06
3
414 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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Introduction This article is the first in a series of articles about the C/C++ Visual Studio Express debugger.  It provides a quick start guide in using the debugger. Part 2 focuses on additional topics in breakpoints.  Lastly, Part 3 focuses on th…
Many modern programming languages support the concept of a property -- a class member that combines characteristics of both a data member and a method.  These are sometimes called "smart fields" because you can add logic that is applied automaticall…
The viewer will learn how to use the return statement in functions in C++. The video will also teach the user how to pass data to a function and have the function return data back for further processing.
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.

729 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