Re: Starting another program




UN wrote:
> We start a new program with
> prg := PgmName+chr(0);
> WinExec(@prg[1],SW_SHOWDEFAULT);

Delphi does that sort of thing for you. There is always a Chr(0) at the
end of every Ansi (long) string, and a PChar typecast returns the
address of the first character.

WinExec(PChar(PgmName), SW_DEFAULT);

Alan Lloyd

.



Relevant Pages

  • Direct Sound
    ... / teaching Direct Sound (mono) with Delphi. ... Alan Lloyd ... Prev by Date: ...
    (comp.lang.pascal.delphi.misc)
  • Fastcode IntToStr B&V version 0.25 and Sort B&V version 0.6
    ... IntToStr: ... Sort: Delphi 5 compatible ... Prev by Date: ...
    (borland.public.delphi.language.basm)
  • Re: Flash Questions
    ... using Flash files in Delphi. ... Alan Lloyd ... Prev by Date: ...
    (comp.lang.pascal.delphi.misc)
  • Re: Word to Byte (chop off MSB)
    ... don't use it on a DWord unless that's what you want. ... That's what Delphi ... Alan Lloyd ... Prev by Date: ...
    (comp.lang.pascal.delphi.misc)
  • Are we waiting for Borland?
    ... Is there supposed to be some sort of detailed announcement about Borland's ... plans for Delphi? ... Prev by Date: ...
    (borland.public.delphi.non-technical)