Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/delphi/9.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
在Inno安装向导中显示Delphi表单_Delphi_Inno Setup_Pascal - Fatal编程技术网

在Inno安装向导中显示Delphi表单

在Inno安装向导中显示Delphi表单,delphi,inno-setup,pascal,Delphi,Inno Setup,Pascal,我在DLL中有一个Delphi表单,我想在Inno设置的向导页面中显示它。以下是这个问题的一个例子: 我使用以下代码行导出我的Delphi表单: procedure CreateWizardForm(ParentWnd: HWND);stdcall; var R: TRect; Form: TOpenSQLServerForm;// the from i want to show begin Form := TOpenSQLServerForm.Create(nil); For

我在DLL中有一个Delphi表单,我想在Inno设置的向导页面中显示它。以下是这个问题的一个例子:

我使用以下代码行导出我的Delphi表单:

procedure CreateWizardForm(ParentWnd: HWND);stdcall;
var
  R: TRect;
  Form: TOpenSQLServerForm;// the from i want to show
begin
  Form := TOpenSQLServerForm.Create(nil);
  Form.ParentWindow := ParentWnd;
  Form.BorderStyle := bsNone;
  GetWindowRect(ParentWnd, R);
  Form.BoundsRect := R;
  Form.Show;
end;
 
在图书馆里我有:

library LoadServerName;

uses
  Winapi.Windows,System.SysUtils, System.Classes, VCL.Forms,VCl.dialogs,
  OpenSQLServer in 'OpenSQLServer.pas' {OpenSQLServerForm};

{$R *.res}

exports
  CreateWizardForm;

begin
end.
最后,我在Inno设置中使用DLL的方式如下:

procedure CreateWizardForm(ParentWnd:HWND);stdcall;
external 'CreateWizardForm@files:LoadServerName.dll stdcall';

procedure InitializeWizard();
begin
  CustomPage := CreateCustomPage(wpSelectDir, 'Caption', 'Description');
  CreateWizardForm(CustomPage.surface.Handle);
end;

当我运行Inno安装程序时,我希望在CustomPage中看到我的向导表单,但它根本没有显示我的表单。有什么问题吗?

有错误吗?你的ISS文件还有其他内容吗?您是否使用LoadDLL加载Delphi DLL?您可能需要调试DLL,以查看它是否出现异常或其他错误。登录DLL也可能有帮助。@martheil运行安装程序时,我希望在customPage中看到我的Delphi表单,但它没有显示我的Delphi表单。您的
CreateWizardForm()
函数使用的是Delphi的默认
寄存器
调用约定。当您在Inno中声明函数时,是否指定了该选项?Inno默认采用
stdcall
。请确保没有不匹配项。请注意,
Form:=TOpenSQLServerForm.Create(nil);Form.ParentWindow:=ParentWnd可以简化为
形式:=TOpenSQLServerForm.CreateParented(ParentWnd)
@RemyLebeau我编辑了我的问题,我想使用正确的方法调用dll函数。有错误吗?你的ISS文件还有其他内容吗?您是否使用LoadDLL加载Delphi DLL?您可能需要调试DLL,以查看它是否出现异常或其他错误。登录DLL也可能有帮助。@martheil运行安装程序时,我希望在customPage中看到我的Delphi表单,但它没有显示我的Delphi表单。您的
CreateWizardForm()
函数使用的是Delphi的默认
寄存器
调用约定。当您在Inno中声明函数时,是否指定了该选项?Inno默认采用
stdcall
。请确保没有不匹配项。请注意,
Form:=TOpenSQLServerForm.Create(nil);Form.ParentWindow:=ParentWnd可以简化为
形式:=TOpenSQLServerForm.CreateParented(ParentWnd)@RemyLebeau我编辑了我的问题,我想用正确的方式调用dll函数