Autor Beitrag
DiamondDog
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 460



BeitragVerfasst: Fr 12.12.08 11:14 
Hallo Leute,
ich hab das Problem das Delphi mir immer sagt:
Undefinierter Bezeichner: 'Handle'
und ich weiß nicht ganz wieso und was ich ändern muss damit es nicht kommt.
Hier mal mein Code:
ausblenden volle Höhe 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:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
42:
43:
44:
45:
46:
47:
48:
49:
50:
51:
52:
53:
54:
55:
56:
57:
58:
59:
60:
61:
62:
63:
64:
65:
66:
67:
68:
69:
70:
71:
72:
73:
74:
75:
76:
77:
78:
79:
80:
81:
82:
83:
84:
85:
86:
87:
88:
89:
procedure TQipPlugin.UpdateCheck;
var ini                     : TIniFile;
    FiPfad                  : string;
    FTPVersion              : string;
    SelfVersion             : string;
    APath                   : string;
    Updater                 : string;
    z                       : integer;
    PunktPos                : integer;
    iFTPVersion             : integer;
    Plugin_FTPVersion_Major : integer;
    Plugin_FTPVersion_Minor : integer;
begin
  FTPVersion   := GetHTML('http://version.txt'); // Versionsinfo vom Server holen

  PunktPos     := pos('.',FTPVersion);                                                 // den Punkt finden
  Plugin_FTPVersion_Major := strtoint(copy(FTPVersion,1,PunktPos-1));                  // erste Zahl auschneiden
  Plugin_FTPVersion_Minor := strtoint(copy(FTPVersion,PunktPos+1,length(FTPVersion))); // letze Zahl auschneiden
  FTPVersion              := StringReplace(FTPVersion, '.', '', [ rfReplaceAll ]);     // Punkt entfernen

  if not TryStrToInt(FTPVersion, iFTPVersion) then // Ist FTPVersion ein Integer?
    begin
      // Nein -> Fehlermeldung
    end else
    begin
      // Ja -> Prüfe auf Update
      if ((Plugin_FTPVersion_Major <>  PLUGIN_VER_MAJOR) or (Plugin_FTPVersion_Minor <> PLUGIN_VER_MINOR)) then  // Ja -> dann weiter
        begin
          // Wenn FTPVersion größer als SelfVersion
          SelfVersion:=inttostr(PLUGIN_VER_MAJOR)+'.'+inttostr(PLUGIN_VER_MINOR);
          //>>>>Hier kommt der Fehler bei Handle<<<<
          case MessageBox(Handle,PChar(PChar(string(PLUGIN_NAME))+' Plugin:'+#10#13+#10#13+PChar('An Update is available')+#10#13+#10#13+PChar('New Version:')+' '+PChar(FTPVersion)+#10#13+PChar('Old Version:')+' '+PChar(SelfVersion)+#10#13+#10#13+PChar('Do you want to close QIP Infium now and install the plug?')),PChar('Info'),0 OR MB_OKCANCEL OR MB_DEFBUTTON1) of
            IDCANCEL:
            begin
              // bei Abbruch
            end;
              IDOK:
            begin
            // bei Ok

            //ListBox100 erzeugen
           FfrmMain.ListBox100Create;

            // Updater.exe finden
            APath:=ExtractFilePath(FDllPath);
            APath:=ExcludeTrailingPathDelimiter(ExtractFilePath(ExcludeTrailingPathDelimiter(APath)));
            FfrmMain.ListBox100.Clear; // Listbox leeren
            FindFiles (APath, '*.exe', False, FfrmMain.ListBox100.Items); // Nach ini suchen

            for z:=0 to FfrmMain.Listbox100.Count-1 do // von 0 biß Zeilenende
              begin
                Updater := FfrmMain.ListBox100.Items.Strings[z];
              end;

            FfrmMain.ListBox100.Destroy; // ListBox100 löschen

            // Prüfen ob Updater vorhanden
            if FileExists(Updater) then
              begin
                // Wenn Updater Existiert

                // In Updater.ini schreiben
                FiPfad        := APath+'\updater.ini';
                ini           := TIniFile.Create(FiPfad);
                ini.WriteString('Main','PluginName',PLUGIN_NAME);
                ini.WriteString('Plugins',PLUGIN_NAME+'_FTPVerPfad','http://diamonddog.jeak.de/infium/onlineip/onlineip_version.txt');
                ini.WriteString('Plugins',PLUGIN_NAME+'_RarPfad','http://diamonddog.jeak.de/infium/onlineip/OnlineIP');
                ini.Free; // ini schließen

                //Updater Starten
                ShellExecute(Handle, nil, PChar(Updater), nil, nil, SW_SHOWNORMAL);
                
                // Infium Schließen
                PlugMsg1.Msg       := PM_PLUGIN_INFIUM_CLOSE;
                PlugMsg1.WParam    := LongInt(0);
                PlugMsg1.DllHandle := FDllHandle;
                FPluginSvc.OnPluginMessage(PlugMsg1);
              end else
              begin
                // Wenn Updater nicht Existiert
                ShowMessage('Error: No Updater found.'+#10#13+'Pleas go on:'+#10#13+'http://www.DiamondDog.de.tt'+#10#13+'and install the Updater in the Folder "Plugins"');
              end;
        end;
      end;
    end
    else begin
      // Wenn FTPVersion gleich oder kleiner als SelfVersion
    end;
  end;
Danke schon mal an alle fürs Helfen.

Mfg Dog
DeddyH
Ehemaliges Mitglied
Erhaltene Danke: 1



BeitragVerfasst: Fr 12.12.08 11:32 
Wenn TQipPlugin kein Fensterhandle hat, trag dafür einfach 0 ein.
DiamondDog Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 460



BeitragVerfasst: Fr 12.12.08 11:43 
Super Funktioniert besten Dank.