Hi,
I have got it going but by using a workaround, which is a lot easier
than working with horrible res files and send message commands, all I
did was to make a blank dlg res file, then use the window handle
returned by the callback function and created my own Delphi form Page :=
Tpage.CreateParented(hdlg) so now I can use the Delphi environment to
design and work with the form and its controls without very many send
Message commands at all... yipppeee!
So thank you to you guys and also to Roman at Expert Exchange for
telling me of this trick.
Regards
>Jason Coley
>Manawatu Software Solutions
-----Original Message-----
From: Carl Reynolds [mailto:[EMAIL PROTECTED]]
Sent: Friday, 9 February 2001 1:37 p.m.
To: Multiple recipients of list delphi
Subject: RE: RE: [DUG]: SendMessage and strings
And for the record, I worried needlessly about reference counting
before. I
now realise that it is completely safe to pass integer(pchar(mystring))
to a
procedure. Reference counting won't free the string in the meantime,
not
unless the string is also passed as an out or var parameter to the same
function. You're safe as long as you don't hold that reference too
long:
// Make MyString with a RefCount of 1
MyString := Copy('AString', 1, MaxInt);
MyRef := Integer(PChar(MyString));
// MyRef is valid here
MyString := 'arg';
// Refcount -> 0, string is released. MyRef is now invalid.
Incidently, the intermediate cast to PChar doesn't do anything at that
point, but it does remind the compiler that MyString needs to be null
terminated.
Cheers,
Carl
P.S. Regular expressions to replace sets of three characters, only at
the
start of a line, by tabs?
Find: "^{ *}{ }" (excluding quotes)
Replace with: "\0 " (excluding quotes)
------------------------------------------------------------------------
---
New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED]
Website: http://www.delphi.org.nz
To UnSub, send email to: [EMAIL PROTECTED]
with body of "unsubscribe delphi"
---------------------------------------------------------------------------
New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED]
Website: http://www.delphi.org.nz
To UnSub, send email to: [EMAIL PROTECTED]
with body of "unsubscribe delphi"