> -----Original Message-----
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On
> Behalf Of Dennis Chuah
> Sent: Monday, 24 January 2000 09:11
> To: Multiple recipients of list delphi
> Subject: RE: [DUG]: Invalid pointer operation
>
>
>
> > if so can you then just pass PChar(S) to your function rather
> > than using an
> > intermediary
> > variable...
>
> Yeah that's right, just use FindWindow (PChar(SomeString) ...
What about
var T: PChar;
[...]
T:=PChar(SomeString);
FindWindow(PChar(S),T);
>
>
> > Question though (as I've not tested it in delphi)... Doesn't
> > an empty string
> > simply mean
> > that the string reference is nil...
> > EG
> > var
> > S :String;
> > begin
> > S := ' '; // S is not nil but a reference a string
> > containing a space
> > S := Trim(S); // Does S now point to a string of length 0 or does it
> > contain nil?
> > end;
>
> S after the Trim becomes a Nil reference because Trim returns a Nil
> reference and the original space string has been deallocated (reference
> count = 0).
The compiler would disagree
FindWindow(PChar(S),PChar(T)) where T='' does NOT work
IMO PChar('') returns a pointer to a string consisting of a null character
(not the same as a nil pointer)
---------------------------------------------------------------------------
New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED]
Website: http://www.delphi.org.nz