Ver Mensaje Individual
  #3  
Antiguo Hace 1 Hora
emailx45 emailx45 is offline
Miembro
 
Registrado: abr 2025
Posts: 21
Reputación: 0
emailx45 Va por buen camino
Thumbs up

Código:
// DevExpress 25.2.4

// TdxProc = procedure;

//  { HMODULEs can be used in place of HINSTs }  = CARDINAL / NATIVEINT (platform dependent 32/64bits) =  0..4294967295 - 0..18446744073709551615
// HMODULE = System.HMODULE;     

procedure TdxUnitsLoader.AddUnit(AInstance: HMODULE; const AUnitName: string; const AInitializeProc, AFinalizeProc: TdxProc);
//
procedure TdxUnitsLoader.RemoveUnit(AInstance: HMODULE; const AUnitName: string; const AFinalizeProc: TdxProc);
//

procedure Hello; // no params
begin
 // your code here
end;

xxxx.AddUnit( 
   Handle {form1.Handle or another HMODULE value like Application.Handle, etc... }, 
   'unit-name-here', 
   Hello {or NIL if you does not use it - your anonymous proc here},
   nil { if doesnt used }
);


procedure TForm2.Button1Click( Sender: TObject );
var
  x: TdxUnitsLoader;
  C: Cardinal;  //0..4294967295;
  NI:NativeUInt; //0..4294967295; ... in 64bits = 18446744073709551615
begin
  Memo1.Text:=  C.MaxValue.ToString + '  -  ' +  NI.MaxValue.ToString;
  //
  x := TdxUnitsLoader.Create;
  x.AddUnit( handle, 'unitname', nil, nil );
  //
  x.RemoveUnit(handle, 'unitname', nil);
end;

Última edición por emailx45 fecha: Hace 1 Hora a las 19:26:40.
Responder Con Cita