473,495 Members | 2,021 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Changing the current directory with the help of dialog window(MFC

Changing the current directory with the help of dialog window(MFC app)
We can change directory with the help of the following code:
CFileDialog m_ldFile(TRUE);
m_ldFile.m_ofn.lpstrInitialDir="c:\\"; // the initial folder.
//below the dialog window is opened, then tfolders and eventually a file
and after automatically current directory is changed .
if(m_ldFile.DoModal()==IDOK)
{
//below finding out the path.
m_strPath=m_ldFile.GetPathName();
UpdateData(FALSE);
}
We don't need to open a file, but only a folder, in order to change
current directory.
Could you explain please, how I can change current directory without
opening file.
Alur.

Nov 17 '05 #1
3 3378
> Could you explain please, how I can change current directory without
opening file.


How about the aptly named SetCurrentDirectory function?

Dave
--
MVP VC++ FAQ: http://www.mvps.org/vcfaq
Nov 17 '05 #2
Alur wrote:
Changing the current directory with the help of dialog window(MFC app)
We can change directory with the help of the following code:
CFileDialog m_ldFile(TRUE);
m_ldFile.m_ofn.lpstrInitialDir="c:\\"; // the initial folder.
//below the dialog window is opened, then tfolders and eventually a file
and after automatically current directory is changed .
if(m_ldFile.DoModal()==IDOK)
{
//below finding out the path.
m_strPath=m_ldFile.GetPathName();
UpdateData(FALSE);
}
We don't need to open a file, but only a folder, in order to change
current directory.
Could you explain please, how I can change current directory without
opening file.
Alur.


Try looking at SHBrowseForFolder()

/steveA

--
Steve Alpert
my email Fgrir_Nycreg @ vqk.pbz is encrypted with ROT13 (www.rot13.org)
and spaces

Nov 17 '05 #3

Hi Guys

What if I dont want to change the current directory when I ope
FileDialog...
Thank
-
stureb
-----------------------------------------------------------------------
Posted via http://www.codecomments.co
-----------------------------------------------------------------------

Nov 17 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
4871
by: Fred | last post by:
Hi, I'd like to turn a command-line script into a Windows GUI app using the native widgets so as to reduce the size of the binary (ie. no QT, wxWidgets, et al.) I came up with the following...
1
2408
by: picard | last post by:
I have seen in various posts that there are tricks to increasing the largest continuous memory block available to an application on a windows machine. I want to prove this is possible using a...
8
712
by: Scott | last post by:
I have written windows applications using MFC for several years and have frequently used MFC techniques. Now I'm moving to C# .NET WinForm. Mostly C# books describes C# language (sometimes...
0
1479
by: sara | last post by:
Hi All, I have a problem with MFC and .NET interop I have created a usercontrol and placed a form on it which holds a tabcontrol with two tabpages which inturn contains a few controls...
3
1989
by: Siddharth Jain | last post by:
Hello, Could someone please tell me the history of GUI programming for windows. In the early days, we had to write 100s of lines of code to make a simple dialog box. Then along came MFC to...
16
1539
by: um | last post by:
What's the deadline for MFC ?
3
9809
by: Sushil Srivastava | last post by:
Hi Guys, Would you be able to help me using C# GUI (with user interface component) in my MFC application. I have used managed extension, COM-interops, etc but problem is this C# component has...
3
1904
by: rag84dec | last post by:
Hi, I am new to this and i am trying to write a code to have a UI (MFC) to insert into database. I created a new project with datadase connected to it. But once i created the project it gave me...
6
5358
by: Tony Johansson | last post by:
Hello! I know there exist some commonDialogs in .NET such as SaveFileDialog,OpenFileDialog printDialog and so. I just want to know if a dialog is the same as a form ? I mean when these...
0
7120
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
6991
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7196
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
6878
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7373
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5456
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
4897
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4583
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
286
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.