尝试复制到剪贴板,如我在 Delphi 示例中找到的那样,但出现错误
[bcc32c 错误] Unit1.cpp(40):使用未声明的标识符“Clipboard”
我连接了库Vcl.Clipbrd
#include <vcl.h>
#pragma hdrstop
#pragma Vcl.Clipbrd
#include "Unit1.h"
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma resource "*.dfm"
TForm1 *Form1;
.....................
void __fastcall TForm1::Button3Click(TObject *Sender)
{
Clipboard()->AsText=DBLookupListBox12->DataField;
}
您需要
#include <Clipbrd.hpp>
,根据 文档示例。
#include <vcl.h>
#pragma hdrstop
#include "Unit1.h"
#include <Clipbrd.hpp>
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma resource "*.dfm"
TForm1 *Form1;
.....................
void __fastcall TForm1::Button3Click(TObject *Sender)
{
Clipboard()->AsText=DBLookupListBox12->DataField;
}