Delphi Pages Forums  

Go Back   Delphi Pages Forums > Delphi Forum > General

Lost Password?

Reply
 
Thread Tools Display Modes
  #1  
Old 01-03-2001, 02:14 AM
TheDuke TheDuke is offline
Senior Member
 
Join Date: Jan 2001
Posts: 269
Default Help with chdir !!!! Turbo Pascal vs Delphi

First of all i apologize for my bad english :P
i'm quite new to delphi so forgive the lame question too.

I'm writing a small console application.
The problem is: How to make delphi chdir work as sweet old TP chdir?

In turbopascal if i chdir('c:\windows'); when the program exit my current working directory is \windows

in delphi the directory change works only while the program is still running. When the program exit the Current Working Directory still is the one from which i launched my application.
I need it changed to c:\windows!!
anybody know how to achive that?

Thanks in advance.
Reply With Quote
  #2  
Old 01-03-2001, 05:48 AM
PoseFant PoseFant is offline
Senior Member
 
Join Date: Jan 2001
Posts: 1,002
Default RE: Help with chdir !!!! Turbo Pascal vs Delphi

This is because the ChDir Procedure, the SetCurrentDir and SetCurrentDirectory Functions are changing the directory in the active process.

Try the application code within a clean DOS environment, not a Command Shell within Windows.

If you start a Shell / Console within another Shell / Console, the memory handling will be separate for each Shell / Console.


There is API functions for controlling Consoles.

Read the SDK help file at Consoles and Character Mode Support.

I hope this helped you out ...


Regards

/Filip
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is On

Forum Jump


All times are GMT. The time now is 11:29 AM.


Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2017, vBulletin Solutions, Inc.