clipboard.dcu not found

Plasmax
Plasmax used Ask the Experts™
on
I have search for this and i am unable to get my code right.

it needs to copy the clipboard contents for

1. text and show in memo
2. picture and show in image

but clipboard is never allowed, even if I add it to the dam uses.


{
Place Timage and Tmemo  on the form.
Retrieve what is in the clipboard. If it is image, it will be placed in Image1, and if text - in Memo1.
}
 
uses Clipboard;
...
 
procedure TForm1.Button1Click(Sender: TObject);
var
  MyHandle: THandle;
begin
  Clipboard.Open;
  if Clipboard.HasFormat(CF_TEXT) then
  begin
    MyHandle:=Clipboard.GetAsHandle(CF_TEXT);
    Memo1.Lines.Add(StrPas(GlobalLock(MyHandle)));
    GlobalUnlock(MyHandle);
  end;
  if (Clipboard.HasFormat(CF_BITMAP)) or
    (Clipboard.HasFormat(CF_PICTURE)) then
    Image1.Picture.Assign(Clipboard);
  Clipboard.Close;
end;

Open in new window

Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Oracle dba
Top Expert 2009
Commented:
it's Clipbrd unit

uses ClipBrd;
 
{$R *.dfm}
 
procedure TForm3.FormCreate(Sender: TObject);
begin
  Clipboard.
end;

Open in new window

Author

Commented:
oh right, thanks for that, clipbrd instead of clipboard  damn..

Geert GOracle dba
Top Expert 2009

Commented:
a unit name and type name must be different in delphi

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial