📄 untfaced.pas
字号:
{*******************************************************}
{ }
{ 单元名称: UntFaceD }
{ 创建日期: 2005-08-29 }
{ 摘要说明: TType.DLL动态调用接口 }
{ }
{ 详细说明: }
{ }
{ 参 阅: }
{ }
{ 已知问题: }
{ }
{ 待作事项: }
{ }
{ 作 者: 胡孟杰 }
{ Copyright (C) 2005 FdAuto }
{ 当前版本: 2.0 }
{ 版本历史: }
{ }
{*******************************************************}
unit UntFaceD;
{==========================================================================
单元接口部分
==========================================================================}
interface
{==========================================================================
参数声明所需引用的单元
==========================================================================}
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
StdCtrls, Variants, ShellAPI, ADODB;
{==========================================================================
函数类型声明部分
==========================================================================}
type
//向表Type中插入一条记录,函数类型声明
TType_AddNew = function(ADOConnection: TADOConnection; P_Type: string):
boolean; stdcall;
//向表Type中更新一条记录,函数类型声明
TType_Edit = function(ADOConnection: TADOConnection; OldType, P_Type: string):
boolean; stdcall;
//向表Type中删除一条记录,函数类型声明
TType_Delete = function(ADOConnection: TADOConnection; P_Type: string):
boolean; stdcall;
//在表Type中查找一条记录,函数类型声明
TType_Find = function(ADOConnection: TADOConnection; P_Type: string): boolean;
stdcall;
//取回类别列表,返回执行成功与否,函数类型声明
TType_GetTypeList = function(ADOConnection: TADOConnection; TypeList:
Tstrings): boolean; stdcall;
//在表Func中插入一条记录,返回执行成功与否,函数类型声明
TFunc_AddNew = function(ADOConnection: TADOConnection;
P_Type, P_Subject, P_Uses, P_Content, P_Remark: string): boolean; stdcall;
//在表Func中更新一条记录,返回执行成功与否,函数类型声明
TFunc_Edit = function(ADOConnection: TADOConnection;
P_ID: integer;
P_Type, P_Subject, P_Uses, P_Content, P_Remark: string): boolean; stdcall;
//在表Func中删除一条记录,返回执行成功与否,函数类型声明
TFunc_Delete = function(ADOConnection: TADOConnection; P_ID: integer):
boolean; stdcall;
//在表Func中查找一条记录,返回执行成功与否,函数类型声明
TFunc_Find = function(ADOConnection: TADOConnection; P_ID: integer): boolean;
stdcall;
//在表Func中查找类别明细,返回执行成功与否,函数类型声明
TFunc_FindType = function(ADOConnection: TADOConnection; P_Type: string):
boolean; stdcall;
//在表Func中批量更新类别
TFunc_UpdateType = function(ADOConnection: TADOConnection; OldType, NewType:
string): boolean; stdcall;
//依据ID在FUNC中取回一条记录,返回记录是否存在,函数类型声明
TFunc_GetRecordByID = function(ADOConnection: TADOConnection;
P_ID: integer;
P_Type, P_Subject, P_Uses: PChar;
P_Content, P_Remark: Tstrings): boolean; stdcall;
//依据ID取回类别,返回记录是否存在,函数类型声明
TFunc_GetTypeByID = function(ADOConnection: TADOConnection; P_ID: Integer;
P_Type: PChar): boolean; stdcall;
//依据类别取得记录集,返回执行成功与否,函数类型声明
TFunc_GetFuncByType = function(ADOQueryF: TADOQuery; P_Type: string): boolean;
stdcall;
//依据标题检索函数库,返回执行成功与否
TFunc_SearchBySubject = function(ADOQueryF: TADOQuery; P_Subject: string):
boolean; stdcall;
//依据标题检索,取得ID标题列表
TFunc_GetIDSubList = function(ADOConnection: TADOConnection; SubKey: string;
IDList, SubList: Tstrings): boolean; stdcall;
//依据类别检索,取得ID标题列表
TFunc_GetIDListByType = function(ADOConnection: TADOConnection; P_Type:
string;
IDList, SubList: Tstrings): boolean; stdcall;
{==========================================================================
接口函数声明
==========================================================================}
procedure ShowMsg(Msg: string); stdcall;
//向表Type中插入一条记录,函数原型声明
function Type_AddNew(ADOConnection: TADOConnection; P_Type: string): boolean;
stdcall;
//向表Type中更新一条记录,函数原型声明
function Type_Edit(ADOConnection: TADOConnection; OldType, P_Type: string):
boolean; stdcall;
//向表Type中删除一条记录,函数原型声明
function Type_Delete(ADOConnection: TADOConnection; P_Type: string): boolean;
stdcall;
//在表Type中查找一条记录,函数原型声明
function Type_Find(ADOConnection: TADOConnection; P_Type: string): boolean;
stdcall;
//取回类别列表,返回执行成功与否,函数原型声明
function Type_GetTypeList(ADOConnection: TADOConnection; TypeList: Tstrings):
boolean; stdcall;
//在表Func中插入一条记录,返回执行成功与否,函数原型声明
function Func_AddNew(ADOConnection: TADOConnection;
P_Type, P_Subject, P_Uses, P_Content, P_Remark: string): boolean; stdcall;
//在表Func中更新一条记录,返回执行成功与否,函数原型声明
function Func_Edit(ADOConnection: TADOConnection;
P_ID: integer;
P_Type, P_Subject, P_Uses, P_Content, P_Remark: string): boolean; stdcall;
//在表Func中删除一条记录,返回执行成功与否,函数原型声明
function Func_Delete(ADOConnection: TADOConnection; P_ID: integer): boolean;
stdcall;
//在表Func中查找一条记录,返回执行成功与否,函数原型声明
function Func_Find(ADOConnection: TADOConnection; P_ID: integer): boolean;
stdcall;
//在表Func中查找类别明细,返回执行成功与否,函数原型声明
function Func_FindType(ADOConnection: TADOConnection; P_Type: string): boolean;
stdcall;
//在表Func中批量更新类别
function Func_UpdateType(ADOConnection: TADOConnection; OldType, NewType:
string): boolean; stdcall;
//依据ID在FUNC中取回一条记录,返回记录是否存在,函数原型声明
function Func_GetRecordByID(ADOConnection: TADOConnection;
P_ID: integer;
P_Type, P_Subject, P_Uses: PChar;
P_Content, P_Remark: Tstrings): boolean; stdcall;
//依据ID取回类别,返回记录是否存在,函数原型声明
function Func_GetTypeByID(ADOConnection: TADOConnection; P_ID: Integer; P_Type:
PChar): boolean; stdcall;
//依据类别取得记录集,返回执行成功与否,函数原型声明
function Func_GetFuncByType(ADOQueryF: TADOQuery; P_Type: string): boolean;
stdcall;
//依据标题检索函数库,返回执行成功与否
function Func_SearchBySubject(ADOQueryF: TADOQuery; P_Subject: string): boolean;
stdcall;
//依据标题检索,取得ID标题列表
function Func_GetIDSubList(ADOConnection: TADOConnection; SubKey: string;
IDList, SubList: Tstrings): boolean; stdcall;
//依据类别检索,取得ID标题列表
function Func_GetIDListByType(ADOConnection: TADOConnection; P_Type: string;
IDList, SubList: Tstrings): boolean; stdcall;
{==========================================================================
单元实现部分
==========================================================================}
implementation
{==========================================================================
过程名: ShowMsg
功 能: 显示提示对话框
参 数: Msg: string
作 者: 胡孟杰
日 期: 2005-08-29
==========================================================================}
procedure ShowMsg(Msg: string); stdcall;
begin
Application.MessageBox(PChar(Msg),
PChar(Application.Title), MB_ICONINFORMATION);
end;
{==========================================================================
函数名: Type_AddNew
功 能: 向表Type中插入一条记录
参 数:
返回值:
作 者: 胡孟杰
日 期: 2005-08-29
==========================================================================}
function Type_AddNew(ADOConnection: TADOConnection; P_Type: string): boolean;
stdcall;
var
FHandle : THandle;
FType_AddNew : TType_AddNew;
begin
result := false;
FHandle := LoadLibrary('TType.dll');
if FHandle <> 0 then
begin
@FType_AddNew := GetProcAddress(FHandle, 'Type_AddNew');
if @FType_AddNew <> nil then
result := FType_AddNew(ADOConnection, P_Type)
else
ShowMsg(PChar('加载函数Type_AddNew失败!'));
end
else
ShowMsg(PChar('加载TType.dll失败!'));
FreeLibrary(FHandle);
end;
{==========================================================================
函数名: Type_Edit
功 能: 向表Type中更新一条记录
参 数:
返回值:
作 者: 胡孟杰
日 期: 2005-08-29
==========================================================================}
function Type_Edit(ADOConnection: TADOConnection; OldType, P_Type: string):
boolean; stdcall;
var
FHandle : THandle;
FType_Edit : TType_Edit;
begin
result := false;
FHandle := LoadLibrary('TType.dll');
if FHandle <> 0 then
begin
@FType_Edit := GetProcAddress(FHandle, 'Type_Edit');
if @FType_Edit <> nil then
result := FType_Edit(ADOConnection, OldType, P_Type)
else
ShowMsg(PChar('加载函数Type_Edit失败!'));
end
else
ShowMsg(PChar('加载TType.dll失败!'));
FreeLibrary(FHandle);
end;
{==========================================================================
函数名: Type_Delete
功 能: 向表Type中删除一条记录
参 数:
返回值:
作 者: 胡孟杰
日 期: 2005-08-29
==========================================================================}
function Type_Delete(ADOConnection: TADOConnection; P_Type: string): boolean;
stdcall;
var
FHandle : THandle;
FType_Delete : TType_Delete;
begin
result := false;
FHandle := LoadLibrary('TType.dll');
if FHandle <> 0 then
begin
@FType_Delete := GetProcAddress(FHandle, 'Type_Delete');
if @FType_Delete <> nil then
result := FType_Delete(ADOConnection, P_Type)
else
ShowMsg(PChar('加载函数Type_Delete失败!'));
end
else
ShowMsg(PChar('加载TType.dll失败!'));
FreeLibrary(FHandle);
end;
{==========================================================================
函数名: Type_Find
功 能: 在表Type中查找一条记录
参 数:
返回值:
作 者: 胡孟杰
日 期: 2005-08-29
==========================================================================}
function Type_Find(ADOConnection: TADOConnection; P_Type: string): boolean;
stdcall;
var
FHandle : THandle;
FType_Find : TType_Find;
begin
result := false;
FHandle := LoadLibrary('TType.dll');
if FHandle <> 0 then
begin
@FType_Find := GetProcAddress(FHandle, 'Type_Find');
if @FType_Find <> nil then
result := FType_Find(ADOConnection, P_Type)
else
ShowMsg(PChar('加载函数Type_Find失败!'));
end
else
ShowMsg(PChar('加载TType.dll失败!'));
FreeLibrary(FHandle);
end;
{==========================================================================
函数名: Type_GetTypeList
功 能: 取回类别列表,返回执行成功与否
参 数:
返回值:
作 者: 胡孟杰
日 期: 2005-08-29
==========================================================================}
function Type_GetTypeList(ADOConnection: TADOConnection; TypeList: Tstrings):
boolean; stdcall;
var
FHandle : THandle;
FType_GetTypeList : TType_GetTypeList;
begin
result := false;
FHandle := LoadLibrary('TType.dll');
if FHandle <> 0 then
begin
@FType_GetTypeList := GetProcAddress(FHandle, 'Type_GetTypeList');
if @FType_GetTypeList <> nil then
result := FType_GetTypeList(ADOConnection, TypeList)
else
ShowMsg(PChar('加载函数Type_GetTypeList失败!'));
end
else
ShowMsg(PChar('加载TType.dll失败!'));
FreeLibrary(FHandle);
end;
{==========================================================================
函数名: Func_AddNew
功 能: 在表Func中插入一条记录,返回执行成功与否
参 数:
返回值:
作 者: 胡孟杰
日 期: 2005-08-29
==========================================================================}
function Func_AddNew(ADOConnection: TADOConnection;
P_Type, P_Subject, P_Uses, P_Content, P_Remark: string): boolean; stdcall;
var
FHandle : THandle;
FFunc_AddNew : TFunc_AddNew;
begin
result := false;
FHandle := LoadLibrary('TType.dll');
if FHandle <> 0 then
begin
@FFunc_AddNew := GetProcAddress(FHandle, 'Func_AddNew');
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -