“bpl”在 IntraWeb 中加载
我正在 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
你的问题 - 或者实际上确切的问题/错误 - 我有点不清楚。通过 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.