“bpl”在 IntraWeb 中加载

发布于 2024-08-06 07:05:31 字数 2268 浏览 9 评论 0原文

我正在 IntraWeb、Delphi2010 中设置“bpl”加载模块,发现以下问题:
我无法创建一个应用程序实例,因为它是一个内部表单。

procedure CargaDoSubModulo;
type
  TIWFormClass = class of TIWForm;

var
  Integra : IIntegracaoIW;
  Formulario : TIWForm;
  intClas : Integer;
  strForm : String;

begin
  strForm := srtPacotes + '_' + Copy ( IntToStr ( Rtn_Alternativa)  + 10000 ), 2, 4 );

// Descrição do formulário
  strDescricaoTela := Des_Tela;
// Nome da classe do formulário
  vrtClasseModulo := 'p_' + strForm + '.dll';

// Nome da rotina interna a ser carregada
  strForm := 'iwfrm_' + strForm;
// Nome da classe do formulário
  vrtNomeFormulario := 'T'    + strForm;
// Verificação se a rotina e compativel com o sistema iwfrm_hrb_0010
  intClas := -1;

  if WebApplication.FindComponent( strForm ) = nil then
  begin
     Formulario := TIWFormClass(FindClass( vrtNomeFormulario )).Create(WebApplication);

     if not Supports (Formulario, IIntegracaoIW) then
     begin
        WebApplication.ShowMessage(CargaTexto(msnRotIncompIntgra), smAlert);
        Exit;
     end;

     Integra := Formulario as IIntegracaoIW;
     with Integra do
     begin
        SetServidor( ParServidor1.Servidor );                             // 1
        SetAreaTrabalho( ParServidor1.AreaTrabalho );                     // 2
        SetIdUsuario( intUsuario );                                       // 3
        SetNomeUsuario( iwlStUsuario.Caption );                           // 11
        SetAcesso( intAcesso );                                           // 4
        SetEmpresa( ParServidor1.Empresa );                               // 5
        SetFilial( ParServidor1.Filial );                                 // 6
        SetIdClasse( intClas );                                           // 8
        SetVersao( strVersaoInterna );                                    // 10
        SetDescricao(Des_Tela );     // 7
        SetEnderecoIP( strIdentificacaoPorta );                           // 13
        SetDataTrabalho( DateToStr(dtDataTrabalho) );                     // 14
        SetIdentificacaoSistema( iwlIdentificacao.Caption );              // 12
        SetModuloCarga(Rtn_Busca ); // 9
     end;
  end;
  TIWAppForm(WebApplication.FindComponent( strForm )).Show;

结尾;

I am setting up a module of "bpl" load in IntraWeb, Delphi2010, and I found the following problem:
I don't get to create an instance the application to not to be this is as an internal form.
.

procedure CargaDoSubModulo;
type
  TIWFormClass = class of TIWForm;

var
  Integra : IIntegracaoIW;
  Formulario : TIWForm;
  intClas : Integer;
  strForm : String;

begin
  strForm := srtPacotes + '_' + Copy ( IntToStr ( Rtn_Alternativa)  + 10000 ), 2, 4 );

// Descrição do formulário
  strDescricaoTela := Des_Tela;
// Nome da classe do formulário
  vrtClasseModulo := 'p_' + strForm + '.dll';

// Nome da rotina interna a ser carregada
  strForm := 'iwfrm_' + strForm;
// Nome da classe do formulário
  vrtNomeFormulario := 'T'    + strForm;
// Verificação se a rotina e compativel com o sistema iwfrm_hrb_0010
  intClas := -1;

  if WebApplication.FindComponent( strForm ) = nil then
  begin
     Formulario := TIWFormClass(FindClass( vrtNomeFormulario )).Create(WebApplication);

     if not Supports (Formulario, IIntegracaoIW) then
     begin
        WebApplication.ShowMessage(CargaTexto(msnRotIncompIntgra), smAlert);
        Exit;
     end;

     Integra := Formulario as IIntegracaoIW;
     with Integra do
     begin
        SetServidor( ParServidor1.Servidor );                             // 1
        SetAreaTrabalho( ParServidor1.AreaTrabalho );                     // 2
        SetIdUsuario( intUsuario );                                       // 3
        SetNomeUsuario( iwlStUsuario.Caption );                           // 11
        SetAcesso( intAcesso );                                           // 4
        SetEmpresa( ParServidor1.Empresa );                               // 5
        SetFilial( ParServidor1.Filial );                                 // 6
        SetIdClasse( intClas );                                           // 8
        SetVersao( strVersaoInterna );                                    // 10
        SetDescricao(Des_Tela );     // 7
        SetEnderecoIP( strIdentificacaoPorta );                           // 13
        SetDataTrabalho( DateToStr(dtDataTrabalho) );                     // 14
        SetIdentificacaoSistema( iwlIdentificacao.Caption );              // 12
        SetModuloCarga(Rtn_Busca ); // 9
     end;
  end;
  TIWAppForm(WebApplication.FindComponent( strForm )).Show;

end;

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

罪#恶を代价 2024-08-13 07:05:31

你的问题 - 或者实际上确切的问题/错误 - 我有点不清楚。通过 FindComponent 定位表单有点不常见。至少你不应该调用 FindComponent 超过 nessecary,因为它可能很慢。

如果您创建一个以 WebApplication 为所有者的表单,它将被添加到 WebApplication.Forms
Web Application.FormCount 是表单的数量(UserSession 在此上下文中是一个表单)。 WebApplication.ActiveForm 是当前显示的表单。

Your question - or actually the exact problem/error - is a bit unclear to me. Locating a form via FindComponent is a bit uncommon. At least you shouldn't call FindComponent more than nessecary, as it is potentially slow.

If you create a Form with WebApplication being the owner, it will be added to WebApplication.Forms
Web Application.FormCount is the number of forms (UserSession is a form in this context). WebApplication.ActiveForm is the form that is currently shown.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文