Autor Beitrag
void*
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 31



BeitragVerfasst: Do 03.07.03 14:47 
Hallo,

folgendes Problem:

Ich habe ein Formular in einer dll, in dieser dll gibt es eine Funktion um das Form anzuzeigen:
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
procedure ShowForm(p: TWinControl);
begin
  Form1:=TForm1.Create(p);
  Form1.Parent:=p;
  {Form1.TabStop:=true;
  Form1.TabOrder:=1;}

  Form1.Show
end;

Das geschieht mit folgendem Code:
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
h:=LoadLibrary('form.dll');
if h=0 then
  // ...
else
begin
   @Show:=GetProcAddress(h, 'ShowForm');
   if @Show<>nil then
      Show(TabSheet1)     
  end
end

Jetze die Besonderheit: Der Dialog wird innerhalb einer TTabSheet die wiederum Teil einer TPageControl ist angezeigt. Das klappt auch noch. Jetzt kann ich zwar mit dem Formular interagieren, aber wenn ich auf die Pfeiltasten oder Tab drücke bezieht er die Eingabe auf das Hauptformular.
Was muß ich noch anders machen?

_________________
Gruß
void*
void* Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 31



BeitragVerfasst: Do 10.07.03 10:41 
Hallo,

da das Problem unbekannt/unlösbar erscheint, hat vielleicht jemand eine Idee für einen Workaround oder eine andere Lösung?

_________________
Gruß
void*
Luckie
Ehemaliges Mitglied
Erhaltene Danke: 1



BeitragVerfasst: Do 10.07.03 11:14 
Warum ist das Formular in der DLL? Und muß es dadrin sein?
patrick
ontopic starontopic starontopic starontopic starontopic starofftopic starofftopic starofftopic star
Beiträge: 1481

WIN2k, WIN XP
D6 Personal, D2005 PE
BeitragVerfasst: Do 10.07.03 11:38 
grundsätzlich:
wenn eine form nicht unbedingt in eine dll muss, sollte man das auf jeden fall das form in die application mit integrieren.
Grund:
1,kleine dateien (eine dll mit einem form hat die selbe größe wie eine application mit einem form)
2. einfacherer zugriff

_________________
Patrick
im zweifelsfall immer das richtige tun!!!
void* Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 31



BeitragVerfasst: Do 10.07.03 14:21 
Hallo,

ja, das Form muss da unbedringt drin sein (wegen Software-Design).

_________________
Gruß
void*
patrick
ontopic starontopic starontopic starontopic starontopic starofftopic starofftopic starofftopic star
Beiträge: 1481

WIN2k, WIN XP
D6 Personal, D2005 PE
BeitragVerfasst: Do 10.07.03 17:17 
hast du es schon einmal mit setfocusprobiert?
wenn das nicht geklappt versuch doch einmal die daten per onFormKeyPress-event abzufangen und den richtigen objekten zuzuweisen.

wir Baden-Württenberger müssen doch zusammen halten 8)

ich bin optimistisch das du das hinkriegst. warum? ganz einfach:
wir können alles...
außer hochdeutsch :mrgreen:

_________________
Patrick
im zweifelsfall immer das richtige tun!!!
void* Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 31



BeitragVerfasst: Fr 11.07.03 07:36 
Danke für den Tipp! Ich werd's ausprobieren. Und mit BaWü muss ich Dir doch glatt zustimmen... :)

_________________
Gruß
void*
void* Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 31



BeitragVerfasst: Fr 11.07.03 10:17 
Hallo,

wie komme ich denn an Tastendrücke ran, die an meine App gerichtet sind? Mit OnKeyPressed oder OnKeyDown kriege ich gar nichts. Für einen Button z.B. funktioniert es allgemein, aber Tab und die Pfeiltasten kriege ich auch nicht.

_________________
Gruß
void*
patrick
ontopic starontopic starontopic starontopic starontopic starofftopic starofftopic starofftopic star
Beiträge: 1481

WIN2k, WIN XP
D6 Personal, D2005 PE
BeitragVerfasst: Sa 12.07.03 07:47 
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
procedure TForm1.FormKeyDown(Sender: TObject; var Key: Word;
  Shift: TShiftState);
begin
case key of
vk_left : begin     //cursortaste links
          //...Deine prozedur
          end;

vk_right: begin     //cursortaste rechts
          //...Deine prozedur
          end;

vk_up   : begin     //cursortaste oben
          //...Deine prozedur
          end;

vk_down : begin     //cursortaste unten
          //...Deine prozedur
          end;

vk_tab  : begin     //tabulator
          //...Deine prozedur
          end;
end;
end;

hat dir das gefehlt?

_________________
Patrick
im zweifelsfall immer das richtige tun!!!
void* Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 31



BeitragVerfasst: Mo 14.07.03 07:03 
Hallo,

das hatte ich schon so, bloss springt er da nie rein.

_________________
Gruß
void*
void* Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 31



BeitragVerfasst: Mo 21.07.03 12:54 
Hallo,

neues Problem oben drauf:

Ich habe das ganze in Delphi 7 ausprobiert (bisher Delphi 5).
Jetzt steigt er in der Zeile
ausblenden Quelltext
1:
Show(TabSheet1)					

aus.

Warum das?

Gruß
void*
patrick
ontopic starontopic starontopic starontopic starontopic starofftopic starofftopic starofftopic star
Beiträge: 1481

WIN2k, WIN XP
D6 Personal, D2005 PE
BeitragVerfasst: Mo 21.07.03 17:22 
ganz einfach:
es heißt nämlich
ausblenden Delphi-Quelltext
1:
TabSheet1.show;					

du kannst aber ach so zwischen verschiedenen tabsheeds umschalten:
ausblenden Delphi-Quelltext
1:
2:
PageControl1.ActivePage:=tabsheet1;
PageControl1.ActivePageIndex:=0;

_________________
Patrick
im zweifelsfall immer das richtige tun!!!
void* Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 31



BeitragVerfasst: Di 22.07.03 09:37 
Hallo,

@Patrick:
Missverständnis: Show ist eine unglücklich benannte Funktion aus meiner DLL.


Die Lösung meines Problems (warum auch immer):

Die Anwendung mit Laufzeit-Packages kompilieren und die Sache funktioniert!

_________________
Gruß
void*
void* Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 31



BeitragVerfasst: Di 22.07.03 09:37 
Nachtrag:

Die DLL muss auch mit Laufzeit-Packages kompiliert werden.
patrick
ontopic starontopic starontopic starontopic starontopic starofftopic starofftopic starofftopic star
Beiträge: 1481

WIN2k, WIN XP
D6 Personal, D2005 PE
BeitragVerfasst: Di 22.07.03 11:18 
:nixweiss:

_________________
Patrick
im zweifelsfall immer das richtige tun!!!