DELPHI中的DLL动态调用参数那里不对呀???
原题意是静态方式的:
公共单元 Commpub.pas
声明如下:
//系统登陆图片
function GetLogoPic: TGraphic; stdcall;external 'LOGOPIC.dll';
//用户权限标题图
function GetSYSQXBTS: TGraphic; stdcall;external 'LOGOPIC.dll';
//RzPageControl1中的LOGO图片
function GetImageJPG: TGraphic; stdcall;external 'LOGOPIC.dll';
//ImageTel 手机号码玄机算标题
function GetImageTel: TGraphic; stdcall;external 'LOGOPIC.dll';
//ImageTel 手机号码玄机算吉字标识
function ImageTelBS: TGraphic; stdcall;external 'LOGOPIC.dll';
在窗体中引用的方式如下:
Image2.Picture.Graphic:=GetImageJPG;
但是现在的问题如何修改成“动态”方式加载这个DLL文件
这个DLL中引用了五次
最好能加上这个结构
case 参数 of
参数1:
begin
end;
参数2:
begin
end;
参数3:
begin
end;
参数4:
begin
end;
参数5:
begin
end;
end;
原题意是静态方式的:
公共单元 Commpub.pas
声明如下:
//系统登陆图片
function GetLogoPic: TGraphic; stdcall;external 'LOGOPIC.dll';
//用户权限标题图
function GetSYSQXBTS: TGraphic; stdcall;external 'LOGOPIC.dll';
//RzPageControl1中的LOGO图片
function GetImageJPG: TGraphic; stdcall;external 'LOGOPIC.dll';
//ImageTel 手机号码玄机算标题
function GetImageTel: TGraphic; stdcall;external 'LOGOPIC.dll';
//ImageTel 手机号码玄机算吉字标识
function ImageTelBS: TGraphic; stdcall;external 'LOGOPIC.dll';
在窗体中引用的方式如下:
Image2.Picture.Graphic:=GetImageJPG;
但是现在的问题如何修改成“动态”方式加载这个DLL文件
这个DLL中引用了五次
最好能加上这个结构
case 参数 of
参数1:
begin
end;
参数2:
begin
end;
参数3:
begin
end;
参数4:
begin
end;
参数5:
begin
end;
end;
解决方案 »
- 求助WebBrowser的框架问题
- 请问TTreeView控件中某些item的文字需要分段显示成不同字体(涉及到多种字体的补字),要如何实现?
- 在多用户模式下,怎么样处理多个用户同时编辑或者处理同一笔记录?
- websnap 图片上载问题?(图片大于10k不灵)
- 关于IdTCPServer的问题
- 刚刚升了一级,体验一下一次放200分的感觉,UP有分 顺便和大家探讨一个问题(无未结帖记录)
- Idhttp控件在Get的时候会卡死,请问是什么原因
- 当鼠标移到button1上时成手状,同时打开了C盘,且同时运行excel
- 我自己编写的软件,能不能在“帮助”、“关于”窗体、“条款”中自己随便写上某某公司(即一个未经注册的公司名,自己瞎编的公司名,不与
- 我想通过程序判断但钱焦点落在DBGrid的哪一行的哪个字段上,该怎么办?
- 关于cxgrid导出到excel
- 在线程里面用form的ADQuery时出现用户“(null)”登陆错误
function GetImageJPG: TGraphic;
type
//RzPageControl1中的LOGO图片
//function GetImageJPG: TGraphic; stdcall;external 'LOGOPIC.dll';
TGetImageJPG=function:TGraphic;stdcall;
const
Dll_LOGOPIC = 'LOGOPIC.dll';
var
fdll: string;
getImage: TGetImageJPG;
h: THandle;
begin
fdll := ExtractFilePath(ParamStr(0)) + Dll_LOGOPIC;
if FileExists(fdll) then
begin
h := LoadLibrary(pChar(fdll));
if h<>0 then
try
begin
@getImage := GetProcAddress(h, 'GetImageJPG');
Result := getImage();
end;
finally
begin
FreeLibrary(h);
Application.MessageBox(PChar('文件错误或者文件损坏'),'错误信息:',MB_ICONERROR);
//close;
Application.Terminate;
end;
end;
end;
end;
//=======================================================
function GetImageJPG: TGraphic;
[错误] usedll.pas(155): '=' expected but '.' found
[错误] usedll.pas(155): '.' expected but ';' found
[错误] usedll.pas(155): '=' expected but '.' found
[错误] usedll.pas(155): '.' expected but ';' found
库文件方式EXE调用
问题已解决