Registrar OCX com Delphi

Delphi

20/10/2004

Pessoal desenvolvi uma aplicacao em delphi com Flash, porem em algumas maquinas nao esta aparecendo as imagens do flash e em outras náo aparece a descricao nos botoes do flash efetuei algumas pesquisas e verifiquei que precisa registrar a OCX, fiz uma rotina conforme abaixo e mesmo assim náo resolve o problema mesmo sem aparecer a imagem a Rotina náo entra no try

Application.Initialize;

Try
Application.CreateForm(TForm1, Form1);
Except
on EOleSysError do Begin
Showmessage(´Entrei no Try´);
ResStream := TResourceStream.Create(0, ´Flash´, RT_RCDATA);
Try FileStream := TfileStream.Create(FSystemDir + ´\SWFLASH.OCX´, fmCreate);
Try
FileStream.CopyFrom(ResStream,0);
Finally
FileStream.Free;
End;
Finally
ResStream.Free;
End;
Try
aHandle := LoadLibrary(PChar(FSystemDir + ´\SWFlash.OCX´));
If (aHandle >= 32) Then Begin
aFunc := GetProcAddress(AHandle,´DLLRegisterServer´);
If (Assigned(aFunc) = True) Then Begin
GetShortPathName(Pchar(FSystemDir + ´\SWFlash.OCX´), aShortPath, 2047);
aCommand := Format(´¬s\regsvr32.exe /s ¬s´,[fSystemDir, ashortPath]);
WinExec(Pchar(aCommand), SW_SHOWNORMAL);
End;
FreeLibrary(aHandle);
End;
Try
Application.CreateForm(TForm1, Form1);
Except
Showmessage(´Não Posso Encontrar o Macromedia ShockWave Flash´);
End
Except
Showmessage(´Não Posso Encontrar o Macromedia ShockWave Flash´);
End;
End;
End;
Application.Run;


Caso algu[em conheca isso se puder ajudar eu agradeco estou usando delphi 5 e flash 2004


Ariovaldo

Ariovaldo

Curtidas 0
POSTAR