Jon,
Quote
> My problem is that I don't appear to have access to help pages for any of the suggestions I've
> found so I can't get the appropriate syntax right: CreateProcess, WinExec or ShellExec. Does
> anyone know where I could find documentation for the Windows API calls that can be used in
> Delphi? Would anyone be kind enough to mail me an example piece of code to accomplish this
> in Delphi 4?
You have the help files - you're like my partner, though: you don't
read README files... <g>
Win32.HLP is located in Program Files\Common Files\Borland Shared\
MSHelp.
You can also use ExecuteFile(), contained in FMXUtils.pas (located
in Delphi4\Demos\Doc\FileManEx) to run an external process.
Quote
> A related problem: I guess from what I have seen that the Windows API calls take strings as
> PChars, for instance the suggestion in the Delphi Developer's Guide
With Delphi 32 bit, this is a piece of cake - there really isn't
any conversion:
var
sStr: String;
begin
sStr := 'This is a value for an API call';
UseApiFunction(PChar(sStr));
end;
That's it... A simple typecast.
Quote
> "Path[0] inaccessible, use Length or SetLength" or "incompatible types".
The problem is that, in Delphi 1 and earlier versions of Pascal,
strings were restricted to 255 characters, and String[0] was
a place to store the length of the string. This isn't true in
32-bit versions of Delphi, where String is the same (by default)
as AnsiString and has virtually no limit (OK, 2GB). The AnsiString
type is 1-based, so the beginning of the string starts at Str[1] -
that's why you got the above error message.
Quote
> And am I missing something, or aren't the Delphi 4 help pages themselves quite annoying: has
> anyone managed to find a list of ASCII codes in there, for instance, which I'd have said was a
> pretty basic and obvious requirement?
ASCII codes aren't really appropriate under Windows, as it doesn't
normally use ASCII (OEM) character sets; it uses the ANSI character
set instead.
I'm sorry - I may be dense, but I'm not sure why this is a 'basic
and obvious requirement'... It may have been in the DOS world, so
you had line drawing and non-US character support... But I've been
developing for Windows for about 5 years now, and haven't needed
an ASCII chart yet...
If you really have a need for one, you can use the Character Map
application that comes with Windows (you may need to install it
from your Windows 95 CD, under the Accessories category).
Quote
> P.S. I'm a newbie, please be gentle...
I hope I met this request... :-)
Ken
--
Ken White
Clipper Functions for Delphi
http://members.aol.com/clipfunc