Click here to Skip to main content
15,897,371 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: How can I get and set the keyboard state? Pin
Edwin Geng16-May-02 6:20
Edwin Geng16-May-02 6:20 
GeneralRe: How can I get and set the keyboard state? Pin
Chris Losinger16-May-02 6:42
professionalChris Losinger16-May-02 6:42 
GeneralAnd now,something completely different Pin
nikoladsp15-May-02 1:26
nikoladsp15-May-02 1:26 
GeneralRe: And now,something completely different Pin
Nish Nishant15-May-02 1:50
sitebuilderNish Nishant15-May-02 1:50 
GeneralWow,it is working!! Pin
nikoladsp19-Jun-02 23:13
nikoladsp19-Jun-02 23:13 
GeneralDeviceIOControl for parallel port Pin
nafiton15-May-02 1:21
nafiton15-May-02 1:21 
GeneralRe: DeviceIOControl for parallel port Pin
jan larsen15-May-02 3:31
jan larsen15-May-02 3:31 
GeneralSetting Current Directory Pin
Andy Latham15-May-02 0:40
Andy Latham15-May-02 0:40 
Hi,

im trying to set the current working directory before going in to a file dialog and then reseting it to its original value after the dialog has closed:


TCHAR strCurrentDirectory[MAX_PATH];
GetCurrentDirectory(MAX_PATH, strCurrentDirectory);

CFileDialog fileDlg(TRUE, ".dot;.doc", NULL, OFN_FILEMUSTEXIST | OFN_HIDEREADONLY | OFN_OVERWRITEPROMPT | OFN_NOCHANGEDIR, "Microsoft Word Templates (*.dot; *.doc)|*.dot;*.doc|HTML Templates (*.htm; *.html)|*.htm; *.html|All files (*.*)|*.*||\0", NULL);

fileDlg.m_ofn.lpstrInitialDir = "c:\\projects\\temp";

if(fileDlg.DoModal() == IDOK)
{
// Do something
}

SetCurrentDirectory(strCurrentDirectory);


But this doesnt work as next time i go in to a different file dialog the current directory is set as c:\projects\temp.

Has anyone had to cope with a similar problem before and if so how did they get around it?

Cheers,

Andy.


GeneralRe: Setting Current Directory Pin
Nish Nishant15-May-02 1:12
sitebuilderNish Nishant15-May-02 1:12 
GeneralRe: Setting Current Directory Pin
Prem Kumar15-May-02 2:27
Prem Kumar15-May-02 2:27 
GeneralRe: Setting Current Directory Pin
Andy Latham15-May-02 2:37
Andy Latham15-May-02 2:37 
GeneralRe: Setting Current Directory Pin
Prem Kumar15-May-02 3:41
Prem Kumar15-May-02 3:41 
GeneralModal dialog closing problem Pin
Patrick Riphagen15-May-02 0:21
Patrick Riphagen15-May-02 0:21 
GeneralRe: Modal dialog closing problem Pin
Nish Nishant15-May-02 0:28
sitebuilderNish Nishant15-May-02 0:28 
QuestionHow can extract a Return Value from a Stored Procedure with ADO Pin
youssef14-May-02 23:48
youssef14-May-02 23:48 
AnswerRe: How can extract a Return Value from a Stored Procedure with ADO Pin
Jon Hulatt14-May-02 23:54
Jon Hulatt14-May-02 23:54 
GeneralRe: How can extract a Return Value from a Stored Procedure with ADO Pin
youssef15-May-02 2:52
youssef15-May-02 2:52 
GeneralRe: How can extract a Return Value from a Stored Procedure with ADO Pin
Jon Hulatt15-May-02 3:08
Jon Hulatt15-May-02 3:08 
GeneralRe: How can extract a Return Value from a Stored Procedure with ADO Pin
Carlos Antollini15-May-02 3:27
Carlos Antollini15-May-02 3:27 
GeneralRe: How can extract a Return Value from a Stored Procedure with ADO Pin
Jon Hulatt15-May-02 5:14
Jon Hulatt15-May-02 5:14 
GeneralRe: How can extract a Return Value from a Stored Procedure with ADO Pin
Carlos Antollini15-May-02 5:27
Carlos Antollini15-May-02 5:27 
GeneralRe: How can extract a Return Value from a Stored Procedure with ADO Pin
Jon Hulatt15-May-02 5:38
Jon Hulatt15-May-02 5:38 
GeneralRe: How can extract a Return Value from a Stored Procedure with ADO Pin
Carlos Antollini15-May-02 5:48
Carlos Antollini15-May-02 5:48 
GeneralRe: How can extract a Return Value from a Stored Procedure with ADO Pin
Jon Hulatt15-May-02 5:46
Jon Hulatt15-May-02 5:46 
GeneralThreads and server side applications Pin
unknown soldier14-May-02 23:44
unknown soldier14-May-02 23:44 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.