Fórum Como utilizar packages em Delphi #169264
14/07/2003
0
Estou tentando montar um package de uma rotina de pesquisa de CEP que tenho desenvolvida em Delphi e gostaria de utiliza-la em todos meus sistemas da mesma forma.
Como pretendo acessa-la em tempo de execução estou tentanto incluir as seguintes linhas na meu package:
[b:05576b47e1]
implementation
{$R *.dfm}
initialization
RegisterClass(TFormPesquisaCep);
[/b:05576b47e1]
ao compilar o package obtenho o seguinte erro:
[b:05576b47e1]
[Error] CepFind.pas(77): Statement expected but ´PROCEDURE´ found
[/b:05576b47e1]
Se eu colocar o initialization no final do código não dá nenhum problema com a compilação do package só que ao tentar utilizá-lo dá o seguinte erro:
[b:05576b47e1]
Project teste1.exe raised exception class EOlesyserror with message ´Colnitialize não foi chamado´
[/b:05576b47e1]
Alguem tem alguma ideia do que seja ???
Alguem tem algum exemplo pratico de como utilizar packages ???
[]s
Paulo Fava
Fava
Curtir tópico
+ 0Posts
14/07/2003
Fava
One day and nothing......
:?
Gostei + 0
15/07/2003
Fava
Acho que vou pesquisar e montar um livro sobre este assunto e vender que nem agua !!!! hehe :P
Gostei + 0
15/07/2003
Fava
Gostei + 0
15/07/2003
Schirmer
... pois o pessoal acha que alguém já respondeu pra vc e não dá mais bola....
vou ver se acho algo para vc...
Gostei + 0
15/07/2003
Fava
initialization
CoInitialize(nil);
finalization
CoUnInitialize;
Só não entendi o porque, uma vez que nào estou utilizando componentes Activex.
Agradeço a atenção de todos que visualizaram esta mensagem.
[i:6536e9118f]
Hello,
Yes, add the following lines to the end of your main form unit.
initialization
CoInitialize(nil);
finalization
CoUnInitialize;
and you will likely have to add the ´ActiveX´ unit to your ´Uses´ clause.
I am using Delphi 5. When I converted a Delphi 3 App which uses a third
party OCX, I got the same error. I dug the UseNet posts from www.Deja.com
to find this answer.
NEW QUESTION:
In Delphi 5, I can no longer reliably use the ´Run - Program Reset´
function during a debugging session. Most of the time Delphi 5 will ´hard
crash´ forcing me to power-on reboot my Win98 computer. When I had no other
choice during debug, I was able to do a ´program reset´ in Delphi 3 with
hardly ever a problem.
Anyone else see this D5 ´program reset´ problem?
I sent a bug report to Inprise and they said ´using program reset is not
reccomended as it corrupts memory´.
As a general rule I don´t terminate a debug session with ´program reset´,
but it makes Delphi 5 pretty useless if it crashes so hard you must
power-on reset. MS VC++ ´program resets´ just fine. I have almost never had
a problem with Delphi 3 ´program resets´. If I remember correctly D1 and D2
were not quite as tolerant as D3, but did not hard crash.
Thanks,
Barry.
At 11:56 PM 1/25/00 +0100, you wrote:
>Delphians,
>
>I am recompiling a delphi 3 application to delphi 4
>
>I manages to compile without errors, but when I start the application
>i got a error :
>
> EoleSysError Colnitialize is not called
>
>Anybody has a idea wher I should look ??
>
>Thanks aforehand
>
>Lee
>
>
>_______________________________________________[/i:6536e9118f]
Gostei + 0
Clique aqui para fazer login e interagir na Comunidade :)