[DUG] Copy WideString to the clipboard
Steve Peacocke
steve.peacocke at gmail.com
Mon Sep 10 15:55:26 NZST 2007
oops - wrong fingers on wrong keys. Sorry Stefan (not Stevan).
BTW: The TTntClipboard declares 2 properties that can use.
public
property AsWideText: WideString read GetAsWideText write SetAsWideText;
property AsText: WideString read GetAsWideText write SetAsWideText;
but both appear to be the same so AsText will be the same as AsWideText.
I presume you would change this to ...
clp := TTntClipboard.Create;
clp.AsText := MyText.Text;
clp.Free;
Steve
On 10/09/2007, Steve Peacocke <steve.peacocke at gmail.com> wrote:
> Hello Csaba,
>
> I was about to writre and checking on this when Stevan came up with
> the right answer. Use TTntClipboard instead of TClipboard. Take a look
> at the class for how to call it - TntClipBrd.pas
>
> Steve
> --
> Steve Peacocke
> http://stevepeacocke.blogspot.com/
>
> On 10/09/2007, Csaba Gajo <csaba at enyem.com> wrote:
> > Hi everyone!
> >
> > I need to copy some text to the clipboard, using the TClipboard object. If
> > I use the old-fashioned way, I would do it like this:
> >
> > clp := TClipboard.Create;
> > clp.SetTextBuf(PChar(MyText.Text));
> > clp.Free;
> >
> > However, if I use Unicode components I will have to deal with WideString
> > and PWideChar. If I try to do
> >
> > clp.SetTextBuf(PWideChar(MyText.Text));
> >
> > I will get an error because the Clipboard expects an ordinary PChar.
> > So how can I copy Unicode text to the clipboard?
> >
> > I'm using Delphi 5 btw.
> >
> > Thanks, Csaba
> >
> >
> > _______________________________________________
> > NZ Borland Developers Group - Delphi mailing list
> > Post: delphi at delphi.org.nz
> > Admin: http://delphi.org.nz/mailman/listinfo/delphi
> > Unsubscribe: send an email to delphi-request at delphi.org.nz with Subject: unsubscribe
> >
>
More information about the Delphi
mailing list