中间件相关
2016-03-30 09:04
519 查看
//获取中间件包含的功能号 unit Unit1; interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls; type TForm1 = class(TForm) Button1: TButton; procedure Button1Click(Sender: TObject); private { Private declarations } public { Public declarations } end; type TFunctionEntry = function(const RunDbName, HisDbName: PChar; const Request: Pointer; ReqLen: Integer; var Answer: Pointer; var Size, Length: Integer): Integer;stdcall; TFunctionQueryInterface=function (Index: Integer; var FunctionNo, Version: SmallInt; Caption: PChar; var Entry: TFunctionEntry): BOOL;stdcall; var Form1: TForm1; implementation {$R *.dfm} procedure TForm1.Button1Click(Sender: TObject); var handle:THandle; sdll:string; QueryInterface:TFunctionQueryInterface; Index: Integer; FunctionNo, Version: SmallInt; Caption: PChar; Entry: TFunctionEntry; begin sdll:='D:\Hsassetmanage30\Bin\hscom\platform\com\s_File.dll'; Index:=0; FunctionNo:=1; Version:=1; Caption:=PChar(StringOfChar(#0, 33)); //按深拷贝理解 需要分配空间 Entry:=nil; handle:=LoadLibrary(PAnsiChar(sdll)); if handle<>0 then begin @QueryInterface:=GetProcAddress(handle, 'QueryInterface'); if @QueryInterface<>nil then begin if QueryInterface(Index,FunctionNo,Version,Caption,Entry) then ShowMessage(IntTostr(FunctionNo)+' '+Caption); end else begin ShowMessage('无对应函数'); end; FreeLibrary(handle); end; end; end.
相关文章推荐
- React.js入门学习第一篇
- oracle一些操作汇总
- twemproxy集群部署
- android 常用URI
- Myeclipse中出现@Override错误
- NPOI读写Excel
- HTML5 APP
- 为什么你的android代码这么混乱
- [转] Android OkHttp完全解析 是时候来了解OkHttp了
- 【图像处理】H.264流媒体播放
- Ubuntu64位下vlc-android编译及解决遇到的问题
- 消息中间件与RPC若干问题简析
- c# dotfuscator 混淆后无法使用
- Android - day five 绑定服务
- S5PV210的时钟系统简介
- Error parsing XML: not well-formed (invalid token) 报错+R文件消失解决的方法
- Android——图片视图(ImageView)、状态开关按钮(ToggleButton)、时钟、图片透明度、滚动和时间选择器
- c的详细学习(2)数据类型,运算符与表达式
- Laravel路由设定和子路由设定实例分析
- 八大排序算法