源程序为
unit UnitElement;interface
uses Classes,Graphics, Controls,Printers,Windows;type
TElement=class(TGraphicControl)
protected
//定义元件图形属性
m_Name:string;//图形对应的电气元件的名称
m_X1,m_Y1,mX2,m_Y2:Integer;//相对坐标
m_RealX1,m_RealY1,m_RealX2,m_RealY2:integer;//绝对坐标
m_RecWidth:integer;//元件图形所在正方形框的边长public
//得到元件图形属性和给元件图形属性赋值的函数
function GetRectEx():TRect;//得到元件坐标属的函数
function SetRectEx(x1,y1,x2,y2:Integer):TRect; //给元件坐标属性赋值的函数
//构造和析构函数
constructor Create(AOwner: TComponent); override; destructor Destroy;override;
//几个比较重要的仅在此出声明而需要在派生类中重载的虚函数
function DrawEx():boolean;virtual;//绘制元件图形
function SelectEx():boolean;virtual;//选择元件图形
procedure MoveToEx(x1,y1:integer);virtual;//移动元件图形
function DeleteEx():boolean;virtual;//删除元件图形
function CopyEx():boolean;virtual;//复制元件图形
function SaveEx(fileName:string):boolean;virtual;//保存元件图形
function LoadEx(fileName:string):boolean;virtual;//装载元件图形
function ClearElement():boolean;virtual;//从屏幕上擦除元件图形
function ReSizeEx(x1,y1,x2,y2:integer):boolean;virtual;//变化元件图形大小
end;
implementationend.错误信息为
[Error] UnitElement.pas(17): Unsatisfied forward or external declaration: 'TElement.GetRectEx'
[Error] UnitElement.pas(18): Unsatisfied forward or external declaration: 'TElement.SetRectEx'
[Error] UnitElement.pas(20): Unsatisfied forward or external declaration: 'TElement.Create'
[Error] UnitElement.pas(22): Unsatisfied forward or external declaration: 'TElement.Destroy'
[Error] UnitElement.pas(24): Unsatisfied forward or external declaration: 'TElement.DrawEx'
[Error] UnitElement.pas(25): Unsatisfied forward or external declaration: 'TElement.SelectEx'
[Error] UnitElement.pas(26): Unsatisfied forward or external declaration: 'TElement.MoveToEx'
[Error] UnitElement.pas(27): Unsatisfied forward or external declaration: 'TElement.DeleteEx'
[Error] UnitElement.pas(28): Unsatisfied forward or external declaration: 'TElement.CopyEx'
[Error] UnitElement.pas(29): Unsatisfied forward or external declaration: 'TElement.SaveEx'
[Error] UnitElement.pas(30): Unsatisfied forward or external declaration: 'TElement.LoadEx'
[Error] UnitElement.pas(31): Unsatisfied forward or external declaration: 'TElement.ClearElement'
[Error] UnitElement.pas(32): Unsatisfied forward or external declaration: 'TElement.ReSizeEx'
[Fatal Error] Unit1.pas(7): Could not compile used unit 'UnitElement.pas'
unit UnitElement;interface
uses Classes,Graphics, Controls,Printers,Windows;type
TElement=class(TGraphicControl)
protected
//定义元件图形属性
m_Name:string;//图形对应的电气元件的名称
m_X1,m_Y1,mX2,m_Y2:Integer;//相对坐标
m_RealX1,m_RealY1,m_RealX2,m_RealY2:integer;//绝对坐标
m_RecWidth:integer;//元件图形所在正方形框的边长public
//得到元件图形属性和给元件图形属性赋值的函数
function GetRectEx():TRect;//得到元件坐标属的函数
function SetRectEx(x1,y1,x2,y2:Integer):TRect; //给元件坐标属性赋值的函数
//构造和析构函数
constructor Create(AOwner: TComponent); override; destructor Destroy;override;
//几个比较重要的仅在此出声明而需要在派生类中重载的虚函数
function DrawEx():boolean;virtual;//绘制元件图形
function SelectEx():boolean;virtual;//选择元件图形
procedure MoveToEx(x1,y1:integer);virtual;//移动元件图形
function DeleteEx():boolean;virtual;//删除元件图形
function CopyEx():boolean;virtual;//复制元件图形
function SaveEx(fileName:string):boolean;virtual;//保存元件图形
function LoadEx(fileName:string):boolean;virtual;//装载元件图形
function ClearElement():boolean;virtual;//从屏幕上擦除元件图形
function ReSizeEx(x1,y1,x2,y2:integer):boolean;virtual;//变化元件图形大小
end;
implementationend.错误信息为
[Error] UnitElement.pas(17): Unsatisfied forward or external declaration: 'TElement.GetRectEx'
[Error] UnitElement.pas(18): Unsatisfied forward or external declaration: 'TElement.SetRectEx'
[Error] UnitElement.pas(20): Unsatisfied forward or external declaration: 'TElement.Create'
[Error] UnitElement.pas(22): Unsatisfied forward or external declaration: 'TElement.Destroy'
[Error] UnitElement.pas(24): Unsatisfied forward or external declaration: 'TElement.DrawEx'
[Error] UnitElement.pas(25): Unsatisfied forward or external declaration: 'TElement.SelectEx'
[Error] UnitElement.pas(26): Unsatisfied forward or external declaration: 'TElement.MoveToEx'
[Error] UnitElement.pas(27): Unsatisfied forward or external declaration: 'TElement.DeleteEx'
[Error] UnitElement.pas(28): Unsatisfied forward or external declaration: 'TElement.CopyEx'
[Error] UnitElement.pas(29): Unsatisfied forward or external declaration: 'TElement.SaveEx'
[Error] UnitElement.pas(30): Unsatisfied forward or external declaration: 'TElement.LoadEx'
[Error] UnitElement.pas(31): Unsatisfied forward or external declaration: 'TElement.ClearElement'
[Error] UnitElement.pas(32): Unsatisfied forward or external declaration: 'TElement.ReSizeEx'
[Fatal Error] Unit1.pas(7): Could not compile used unit 'UnitElement.pas'
解决方案 »
- delphi 替换页眉的问题
- 有没有哪位好心人给个波形显示的源码啊?
- DBCtrlGrid如何调整每一行的高度?
- 请问怎么用delphi将中文字转成UTF-8 在线。。
- 气愤啊,老子新买的大众POLO车不见了,上海真XXX的乱!
- 关于托盘的问题
- 请大家帮忙:如何将字符串转成十进制数? 在线等!
- 如何才能过滤掉网页中的Flash,或使停止
- 关于窗体的分辨率的问题?进者有分!
- Delphi制作登陆窗口SQL验证账号密码,如何判断另一个IP同时在别处登陆相同的账号?
- Tadoquery 查询的怪事,难道是bug吗?
- 用过cxtreelist或cxgrid的请进,简单问题,高分相送^_^很急啊,谢谢相救!
function DrawEx():boolean;virtual;//绘制元件图形
这一行然后按Ctrl+Shift+C