The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.
|
 |
|
Dev Shed Forums
> Programming Languages - More
> Delphi Programming
|
DLL's, storing user options, and TOpenDialog
Discuss DLL's, storing user options, and TOpenDialog in the Delphi Programming forum on Dev Shed. DLL's, storing user options, and TOpenDialog Delphi Programming forum discussing Delphi related topics including Kylix, C++ Builder, and more. Delphi is a high-performance language, originally based on the PASCAL language.
|
|
 |
|
|
|
|

Dev Shed Forums Sponsor:
|
|
|

July 4th, 2004, 02:08 PM
|
 |
Introspective
|
|
Join Date: Nov 2001
Location: London, UK
|
|
|
DLL's, storing user options, and TOpenDialog
Hi chaps,
Just for the fun of it, I wrote my first ever Delphi app last week. It's a file uploader (see here) . I admit that it's just a wrapper for pscp.exe and there's lots missing, hence the following questions:
o Is there a more elegant way of calling pscp instead of using CreateProcess?. I would like to be able to use a dll instead and report upload progress through the application UI instead of a popup .exe screen. Any ideas on how this could be done?
o Users can only select multiple files at the moment. I have considered changing the function used here to "SelectDirectory" with a checkbox option to upload recursively. However, the ultimate solution would allow either a directory selection OR a multiple file selection. Is there a graceful way of calling a single dialog which would allow this?
o The app builds a remove path as /home/<username>. The user has the option of changing the path if required. A better plan would allow user options to save a 'default path', a 'pscp.exe location', a 'default hostname' etc and load it in every time the app runs. I intend to store this data on a user-based config file, but can't decide where to put it (assuming user is on WinXP). What's the usual protocol here?
I'll have plenny more naff questions over the next couple weeks
Cheers
christo
__________________
This is me: http://chris.uk.com
|

July 5th, 2004, 01:23 AM
|
 |
Banned ;)
|
|
Join Date: Nov 2001
Location: Woodland Hills, Los Angeles County, California, USA
|
|
Let's see if I can answer your questions without looking at the source  .
1. There's always ShellExecute() and WinExec().
http://msdn.microsoft.com/library/d...hellexecute.asp
http://msdn.microsoft.com/library/d...ase/winexec.asp
I think I posted some examples of ShellExecute in this forum a couple of weeks ago, so you should have some examples for reference  .
As for part two, does pscp come with a DLL? If not, you can always try hiding the DOS window (Call ShellExecute() with SW_HIDE as the last argument)
2. I guess you'd have to write your own dialog then, instead of using the Windows standard dialog. The trouble is that the File Selection dialog that Windows provides doesn't allow directory selection  .
3. Best (and most standard) place to put it would be the Windows Registry. Since you're just starting with Delphi and Windoze programming, don't worry about this yet. However, when you feel ready to muck about in the registry, simply look at the Delphi help for TRegistry, which encapsulates a lot of the registry manipulation functions.
__________________
Up the Irons
What Would Jimi Do? Smash amps. Burn guitar. Take the groupies home.
"Death Before Dishonour, my Friends!!" - Bruce D ickinson, Iron Maiden Aug 20, 2005 @ OzzFest
Down with Sharon Osbourne
Last edited by Scorpions4ever : July 5th, 2004 at 01:27 AM.
|
Developer Shed Advertisers and Affiliates
| Thread Tools |
Search this Thread |
|
|
|
| Display Modes |
Rate This Thread |
Linear Mode
|
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
|
|