Visual C++ file selection dialog

This is a discussion on Visual C++ file selection dialog within the C++ Programming forums, part of the General Programming Boards category; In Visual C++ 6.0, I require to select a file to open and would like to use the standard file ...

  1. #1
    Registered User
    Join Date
    Jan 2006
    Posts
    6

    Visual C++ file selection dialog

    In Visual C++ 6.0, I require to select a file to open and would like to use the standard file selector dialog to get a filename. What function do I call for that? Does anybody know of a web page with some sample code, or just the function name that I could look up?

  2. #2
    Cat without Hat CornedBee's Avatar
    Join Date
    Apr 2003
    Posts
    8,892
    GetOpenFileName, look it up in the MSDN.
    All the buzzt!
    CornedBee

    "There is not now, nor has there ever been, nor will there ever be, any programming language in which it is the least bit difficult to write bad code."
    - Flon's Law

  3. #3
    semi-colon generator ChaosEngine's Avatar
    Join Date
    Sep 2005
    Location
    Chch, NZ
    Posts
    597
    or CFileDialog which is an MFC wrapper around GetOpenFileName.

    and ditch Visual C++ 6.0, it's a buggy broken compiler. Get the free visual studio 2005 express instead (or dev-cpp)
    "I saw a sign that said 'Drink Canada Dry', so I started"
    -- Brendan Behan

    Free Compiler: Visual C++ 2005 Express
    If you program in C++, you need Boost. You should also know how to use the Standard Library (STL). Want to make games? After reading this, I don't like WxWidgets anymore. Want to add some scripting to your App?

  4. #4
    Registered User
    Join Date
    Mar 2002
    Posts
    203
    CFileDialog won't work in the free Visual Studio 2005 Express though

  5. #5
    Registered User
    Join Date
    Jan 2006
    Posts
    6
    The CFileDialog requires that I add an #include<afxdlgs.h>, but the latter does not permit me to include windows.h which I need with CreateThread and CreateSemaphore. What do I do?
    Frank

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. more then 100errors in header
    By hallo007 in forum Windows Programming
    Replies: 20
    Last Post: 05-13-2007, 08:26 AM
  2. Unknown Memory Leak in Init() Function
    By CodeHacker in forum Windows Programming
    Replies: 3
    Last Post: 07-09-2004, 09:54 AM
  3. Stupid compiler errors
    By ChrisEacrett in forum C++ Programming
    Replies: 9
    Last Post: 11-30-2003, 04:44 PM
  4. MS Visual C++ 6 wont include vector.h in a header file
    By bardsley99 in forum C++ Programming
    Replies: 9
    Last Post: 11-06-2003, 11:05 AM
  5. Using 'if' with char arrays or string objects
    By c++_n00b in forum C++ Programming
    Replies: 36
    Last Post: 06-06-2002, 09:04 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21