Autor Beitrag
D. Annies Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 1843

windows 7
D6 Enterprise, D7 Pers und TD 2006
BeitragVerfasst: Do 09.04.09 14:23 
Was muss ich denn nun tun? :? :?

Detlef

_________________
ut vires desint, tamen est laudanda voluntas
BenBE
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 8721
Erhaltene Danke: 191

Win95, Win98SE, Win2K, WinXP
D1S, D3S, D4S, D5E, D6E, D7E, D9PE, D10E, D12P, DXEP, L0.9\FPC2.0
BeitragVerfasst: Do 09.04.09 14:38 
Meinen Post lesen, verstehen und umsetzen ;-)

Konkret bedeutet dies: Meinen anderen Post mit dem Quelltext lesen, die in ersterem referenziertem Post genannte Stelle suchen (gibt nicht so viele, die da zutreffen) und diese ändern (so wie in ersterem Post erwähnt.

Zu risiken und Nebenwirkungen empfehle ich :arrow: Crashkurs Delphi von user profile iconChristian S.

_________________
Anyone who is capable of being elected president should on no account be allowed to do the job.
Ich code EdgeMonkey - In dubio pro Setting.
D. Annies Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 1843

windows 7
D6 Enterprise, D7 Pers und TD 2006
BeitragVerfasst: Do 09.04.09 17:38 
Hi Benny,

wäre schön, wenn du noch einmal etwas konkreter hilfst.
(Es ist nicht so, dass ich mich nicht bemühe, deinen Code zu verstehen)
Danke, Detlef

---Moderiert von user profile iconNarses: Beiträge zusammengefasst---

Hi, Benny,

es ist definitiv die Codestelle, durch die Popupmenu6 ersetzt wird (werden soll) durch

ausblenden Delphi-Quelltext
1:
TPopupMenu(TMenuItem(sender).Owner					


Ist da etwas falsch?

Moderiert von user profile iconNarses: Delphi-Tags hinzugefügt

_________________
ut vires desint, tamen est laudanda voluntas
jaenicke
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 19346
Erhaltene Danke: 1754

W11 x64 (Chrome, Edge)
Delphi 12 Pro, C# (VS 2022), JS/HTML, Java (NB), PHP, Lazarus
BeitragVerfasst: Fr 10.04.09 00:28 
Ich markiere mal den entsprechenden Teil:
user profile iconBenBE hat folgendes geschrieben Zum zitierten Posting springen:
ausblenden Delphi-Quelltext
1:
TQuery(TDBGrid(TPopupMenu(TMenuItem(Sender).Owner).popupComponent).Datasource.Dataset);					
user profile iconBenBE hat folgendes geschrieben Zum zitierten Posting springen:
Oops, übersehen. TQuery ist bereits die Datasource, nicht erst das DataSet ...
Na was schlussfolgerst du daraus? ;-)
Richtig, weg damit.
D. Annies Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 1843

windows 7
D6 Enterprise, D7 Pers und TD 2006
BeitragVerfasst: Fr 10.04.09 08:19 
Hi,

folgender Code geht = erste Zeile
geht nicht = zweite Zeile:

ausblenden Delphi-Quelltext
1:
2:
Qx2Excel(TQuery(TDBGrid(PopupMenu6.popupComponent).Datasource.DataSet));  // geht
Qx2Excel(TQuery(TDBGrid(TPopupMenu(TMenuItem(sender).Owner).popupComponent).Datasource));


!

_________________
ut vires desint, tamen est laudanda voluntas
jaenicke
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 19346
Erhaltene Danke: 1754

W11 x64 (Chrome, Edge)
Delphi 12 Pro, C# (VS 2022), JS/HTML, Java (NB), PHP, Lazarus
BeitragVerfasst: Fr 10.04.09 08:22 
Versuch mal Parent statt Owner, Owner muss ja nicht das Popupmenü sein.

Außerdem gehört dann das DataSet wohl doch dazu, wenn die erste Zeile geht. Ich selbst kenne die Komponente nicht weiter, ich hatte nur das Zitat oben gelesen.
D. Annies Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 1843

windows 7
D6 Enterprise, D7 Pers und TD 2006
BeitragVerfasst: Fr 10.04.09 08:49 
Das geht leider auch nicht.

_________________
ut vires desint, tamen est laudanda voluntas
jaenicke
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 19346
Erhaltene Danke: 1754

W11 x64 (Chrome, Edge)
Delphi 12 Pro, C# (VS 2022), JS/HTML, Java (NB), PHP, Lazarus
BeitragVerfasst: Fr 10.04.09 08:50 
Hast du denn mal im Debugger geschaut was da wo drin steht, bei den ganzen Casts in der Zeile?
D. Annies Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 1843

windows 7
D6 Enterprise, D7 Pers und TD 2006
BeitragVerfasst: Fr 10.04.09 08:59 
Nein, aber vielleicht ist dann ja die Logik, dass ich eine Proc mit dem Namen des PopupMenu's als Übergabeparameter haben muss. (?).

Aber ich warte denn mal auf eine [abschließende] Klarstellung --> von Benny ?

Grüße aus Lübeck :wink:

_________________
ut vires desint, tamen est laudanda voluntas
jaenicke
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 19346
Erhaltene Danke: 1754

W11 x64 (Chrome, Edge)
Delphi 12 Pro, C# (VS 2022), JS/HTML, Java (NB), PHP, Lazarus
BeitragVerfasst: Fr 10.04.09 09:08 
Einfach schnell im Debugger nachschauen was an der Stelle da drin steht, würde jedenfalls sicher sehr viel schneller gehen... :roll:
D. Annies Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 1843

windows 7
D6 Enterprise, D7 Pers und TD 2006
BeitragVerfasst: Fr 10.04.09 09:17 
Ich weiß nicht, wie das geht.

_________________
ut vires desint, tamen est laudanda voluntas
jaenicke
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 19346
Erhaltene Danke: 1754

W11 x64 (Chrome, Edge)
Delphi 12 Pro, C# (VS 2022), JS/HTML, Java (NB), PHP, Lazarus
BeitragVerfasst: Fr 10.04.09 09:19 
Den Ausdruck markieren und Strg + F7 drücken. Zum Beispiel kannst du dann in dem Fenster auch diesen Ausdruck auswerten:
ausblenden Delphi-Quelltext
1:
TMenuItem(Sender).Owner.Name					
D. Annies Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 1843

windows 7
D6 Enterprise, D7 Pers und TD 2006
BeitragVerfasst: Fr 10.04.09 09:33 
Bei deinem Ausdruck steht im Ergebnis nichts und bei meinem Ausdruck steht ebenfalls nichts;

(ich musste ihn aber noch (in der Anzeige) vervollständigen, weil er trotz Markieren
nicht ganz dargestellt wurde.)

_________________
ut vires desint, tamen est laudanda voluntas
jaenicke
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 19346
Erhaltene Danke: 1754

W11 x64 (Chrome, Edge)
Delphi 12 Pro, C# (VS 2022), JS/HTML, Java (NB), PHP, Lazarus
BeitragVerfasst: Fr 10.04.09 09:36 
Dann musst du schauen was in den verschiedenen Teilen drin steht:
ausblenden Delphi-Quelltext
1:
2:
Sender.Name // sollte der Name des Menüitems sein
TMenuItem(Sender).Parent.Name // könnte das Popupmenü sein
Und so weiter, du musst die Arbeit mit dem Debugger schon lernen, sonst kommst du nie weit, wenn ein Fehler auftritt. ;-)
D. Annies Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 1843

windows 7
D6 Enterprise, D7 Pers und TD 2006
BeitragVerfasst: Fr 10.04.09 09:42 
In beiden Fällen: Undefinierter Bezeichner TMenuItem

P.S. Ich bin ja froh über Hilfe, ihr knackt das schon - fragt sich nur, wie.

_________________
ut vires desint, tamen est laudanda voluntas
D. Annies Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 1843

windows 7
D6 Enterprise, D7 Pers und TD 2006
BeitragVerfasst: Fr 10.04.09 09:52 
So, nun hab ich es. (Inspektor Zufall)
Es muss heißen:

ausblenden Delphi-Quelltext
1:
Qx2Excel(TQuery(TDBGrid(TPopupMenu(TMenuItem(sender).GetParentComponent).popupComponent).Datasource.DataSet));					


So, nun ist dieses Problem wohl (ohne Ironie) gelöst ...

Gruß, Detlef

_________________
ut vires desint, tamen est laudanda voluntas