Foros Club Delphi

Foros Club Delphi (https://www.clubdelphi.com/foros/index.php)
-   Varios (https://www.clubdelphi.com/foros/forumdisplay.php?f=11)
-   -   Cargar animacion Flash (https://www.clubdelphi.com/foros/showthread.php?t=42217)

JesusG 08-04-2007 20:13:09

Cargar animacion Flash
 
Es posible que mi duda sea bastante ridicula pero me gustaria que me indicarais como puedo cargar el componente par reproducir animaciones flash en mi aplicacion. Estoy trabajando con Delphi 2006. Ademas quisiera saber si es posible insertar o distribuir con mi aplicacion el control flash, para que se pueda ejecutar en sistemas que no tengan instalados el reproductor flas. Por ultimo, ¿podria intertar en mi exe, unas 10 animaciones flash de 1Mb aproximadamente cada una?, es decir, ¿tendria problemas de memoria utilizada?.
Gracias.

German 09-04-2007 14:25:12

http://delphi.about.com/od/graphics/l/aa040103a.htm

Salu2.

MAXIUM 16-10-2007 23:20:02

Malditas OCX... habra forma de no tener que registrar el componente para su uso. ¿Se puede transfornar un OCX en DLL y así usarlo en el directorio raíz de la aplicación?

German 17-10-2007 19:00:37

Puedes registrar el OCX desde tu propio programa...
Código:

uses ShellApi

(...)

procedure RegistrarOCX;
type TRegFunc = function : HResult; stdcall;
var tmpHandle: tHandle;
    tmpRegFunc : TRegFunc;
    tmpRutaOCX: String;
begin
  tmpRutaOCX := 'C:\Una ruta cualquiera\SWF.ocx';
  tmpHandle := LoadLibrary(pAnsiChar(tmpRutaOCX));
  if ( tmpHandle <> 0 ) then
  begin
    tmpRegFunc := GetProcAddress( tmpHandle, 'DllRegisterServer' );
    if Assigned( tmpRegFunc ) then
    begin
      Ejecutar_Y_Esperar('regsvr32.exe', '/s ' + ExtractShortPathName(tmpRutaOCX));
    end;
    FreeLibrary(tmpHandle);
  end;
end;

function Ejecutar_Y_Esperar(const ExecuteFile, ParamString : string): boolean;
var
  SEInfo: TShellExecuteInfo;
  ExitCode: DWORD;
begin
  FillChar(SEInfo, SizeOf(SEInfo), 0);
  SEInfo.cbSize := SizeOf(TShellExecuteInfo);
  with SEInfo do begin
    fMask := SEE_MASK_NOCLOSEPROCESS;
    Wnd := Application.Handle;
    lpFile := PChar(ExecuteFile);
    lpParameters := PChar(ParamString);
    nShow := SW_HIDE;
  end;
  if ShellExecuteEx(@SEInfo) then
  begin
    repeat
      Application.ProcessMessages;
      GetExitCodeProcess(SEInfo.hProcess, ExitCode);
    until (ExitCode <> STILL_ACTIVE) or Application.Terminated;
    Result:=True;
  end
  else Result:=False;
end;

Sacado de http://delphi.about.com/od/windowssh.../aa040803a.htm
En principio el código valdria para registrar cualquier control OCX cambiando el valor de tmpRutaOCX.

Salu2.

MAXIUM 17-10-2007 21:12:49

Mmmm... esto crearía una venta en shell visible para el usuario y lo otro ¿que pasa si el control ya esta registardo? aunque se prodria crear una secuencia que detecte esto antes de registar, todo el proceso tomaria cierto tiempo.

Bueno, que se le va ha hacer, lo iedal seria poder convertir un OCX en DLL Moco$soft y la Bill Gates que la pario jajaja :rolleyes:

cHackAll 17-10-2007 22:23:41

Acá la misma solución de German pero sin tener que ejecutar ninguna aplicación. Convertir un OCX (ActiveX) en una DLL (Librería dinámica) pues creo que no será posible.

Saludos


La franja horaria es GMT +2. Ahora son las 07:51:22.

Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2026, Jelsoft Enterprises Ltd.
Traducción al castellano por el equipo de moderadores del Club Delphi