Ver Mensaje Individual
  #2  
Antiguo 15-06-2005
Avatar de Investment
Investment Investment is offline
Miembro
 
Registrado: may 2003
Posts: 378
Reputación: 21
Investment Va por buen camino
Post

Este procedinmiento te registra Midas.dll para que no te de ese error.

Código:
procedure TFRMain.RegisterAxLib;
 type
   TRegProc = function : HResult; stdcall;
   TRegAction = (raReg, raUnreg);
 
 const
   ProcName: array[TRegAction] of PChar = (
 	'DllRegisterServer', 'DllUnregisterServer');
 
 Var
   RegAction: TRegAction;
   LibHandle: THandle;
   FileName: String;
   RegProc: TRegProc;
 begin
   FileName:='Ojo, Escribe la ruta\Midas.dll'; // Normalmente c:\windows\system32\Midas.dll
   RegAction:=raReg;
   LibHandle := LoadLibrary(PChar(FileName));
   if LibHandle = 0 then raise Exception.CreateFmt('Error', [FileName]);
   try
 	@RegProc := GetProcAddress(LibHandle, ProcName[RegAction]);
 	if @RegProc = Nil then
 	  raise Exception.CreateFmt('Error', [ProcName[RegAction],
 		FileName]);
 	if RegProc <> 0 then
 	  raise Exception.CreateFmt('Error', [ProcName[RegAction], FileName]);
   finally
 	FreeLibrary(LibHandle);
   end;
 end;
__________________
Saludos,
Peter Investment
Responder Con Cita