Announcement

Collapse
No announcement yet.

MDI DLL in D5

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • MDI DLL in D5

    Ich rufe wie unten beschrieben ein MDI Fenster aus einer DLL auf.
    Leider habe ich das Problem unter Delphi 5 funktioniert die Tabulatortaste der MDI-Fenster nicht mehr. Die Hauptfenster funktionieren voll normal, Modale Fenster auch. hat jemand das problem schon in dieser form gekannt oder kann mir sagen, wie ich dem aus dem Weg gehen kann???

    [email protected]

    TYPE
    T_ProvaChild = procedure (ParentApplication: TApplication; ParentForm: TForm); stdcall;

    procedure TMainForm.StartClick(Sender: TObject);
    var
    DllHandle: THandle;
    ProcAddr: FarProc;
    ProvaChild: T_ProvaChild;
    begin
    DllHandle := LoadLibrary('ProjectDll');
    ProcAddr := GetProcAddress(DllHandle, 'ProvaChild');
    if ProcAddr <> nil then
    begin
    ProvaChild := ProcAddr;
    ProvaChild(Application,Self);
    end;
    end;

    DLL-Code:

    VAR
    DllApplication : TApplication;

    procedure ProvaChild(ParentApplication: TApplication; ParentForm: TForm); export; stdcall;
    var
    Form1: TForm1;
    begin
    IF DllApplication = NIL THEN DllApplication := Application;

    Application:=ParentApplication;

    Form1:=TForm1.Create(ParentForm);
    Form1.Name := '';
    Form1.MyParentForm:=ParentForm;
    Form1.MyParentApplication:=ParentApplication;
    Form1.Show;
    end;

    procedure DLLUnloadProc(Reason: Integer); register;
    begin
    if Reason = DLL_PROCESS_DETACH then Application:=DllApplication;
    end;

    exports
    ProvaChild;

    begin
    DllApplication:=Application;
    DLLProc := @DLLUnloadProc;
    end.
Working...
X