Einzelnen Beitrag anzeigen

Bemo

Registriert seit: 28. Sep 2006
11 Beiträge
 
Delphi 7 Professional
 
#3

Re: Bestehende Anwendung in dll wandeln

  Alt 28. Sep 2006, 15:22
Ich habe meine Anwendung zunächst als dll compiliert und dann um folgende procedure erweitert, die als Initialisierung vom C-Programm gerufen wird:

Delphi-Quellcode:
procedure Initialize(pos_x,pos_y:integer);stdcall;
  var
    start:boolean;
begin
  start:=true;
  F10Msge := TF10Msge.Create(Application);
  F27End := TF27End.Create(Application);
  SerKomWin := TSerKomWin.Create(Application);
  F02Key := TF02Key.Create(Application);
  F35Wait := TF35Wait.Create(Application);
  F03SetOp := TF03SetOp.Create(Application);
  F31Vol := TF31Vol.Create(Application);
  F37AirExt := TF37AirExt.Create(Application);
  F13Wrk1 := TF13Wrk1.Create(Application);
  F12Ped := TF12Ped.Create(Application);
  F04Direct := TF04Direct.Create(Application);
  F11Para := TF11Para.Create(Application);
  F19Test := TF19Test.Create(Application);
  F18OPE := TF18OPE.Create(Application);
  F08CStore := TF08CStore.Create(Application);
  F09Change := TF09Change.Create(Application);
  F15Move := TF15Move.Create(Application);
  F20Copy := TF20Copy.Create(Application);
  F06OptSys := TF06OptSys.Create(Application);
  F17YesNo := TF17YesNo.Create(Application);
  F16SelfTest:= TF16SelfTest.Create(Application);
  F05Option := TF05Option.Create(Application);
  F07DirSurg := TF07DirSurg.Create(Application);
  F21Info := TF21Info.Create(Application);
  F22Help := TF22Help.Create(Application);
  F23PedStd := TF23PedStd.Create(Application);
  F24PedDisp := TF24PedDisp.Create(Application);
  F25OptUs := TF25OptUs.Create(Application);
  F26Unbl := TF26Unbl.Create(Application);
  F28MemSave := TF28MemSave.Create(Application);
  F29Mem := TF29Mem.Create(Application);
  F30MemChg := TF30MemChg.Create(Application);
  F32Color := TF32Color.Create(Application);
  F33Sensor := TF33Sensor.Create(Application);
  F34LeaveWrk:= TF34LeaveWrk.Create(Application);
  F36PedPara := TF36PedPara.Create(Application);
  F14Service := TF14Service.Create(Application);
  F01Start := TF01Start.Create(Application);

  F01Start.Top := pos_x;
  F01Start.Left := pos_y;
  F27End.Top := pos_x;
  F27End.Left := pos_y;
  F03SetOp.Top := pos_x;
  F03SetOp.Left := pos_y;
  F03SetOP.Position := poDefault;
  F13Wrk1.Top := pos_x;
  F13Wrk1.Left := pos_y;
  F13Wrk1.Position := poDefault;
  
  try
    F01Start.ShowModal;
  finally
    F01Start.Release;
  end;
end;
Das Formular F01Start ist das Hauptfenster meines Delphi-Programms. Von hier aus verzweigt das Programm dann je nachdem noch auf andere Modal-Fenster. Die Parameter pos_x und pos_y geben dem C-Programm die Möglichkeit, das Delphi Programm auf dem Bildschirm zu positionieren, da die Delphi Applikation "kleiner" ist, als das C-Programm Formular.


Grüße

[edit=SirThornberry]Delphi-Tags gesetzt. Nächstes mal bitte selbst machen. Mfg, SirThornberry[/edit]
  Mit Zitat antworten Zitat