![]() |
call Iinit() - DEC
Hi ihrs,
hab mal ein kleines Problem mit Hagens DEC. Seit dem ich die Passwortabfrage am anfang meines Programmes rausgenommen habe, bekomme ich immer die Exception, das ich doch bitte Init oder InitKey in TCipherBlowfish aufrufen soll. Das verstehe ich leider nicht so ganz. Die Exception kommt gleich nach dem FormCreate event. Offensichtlich wird dann ja Code in den DEC-Units ausgeführt. Die Funktion für die Passwort anfrage sieht so aus:
Delphi-Quellcode:
die encode Funktion:
Randomize;
zufall := Random(65000); PostMessage(Handle, WM_USER + 1024, 0, 0); // setzt das PasswordChar in der Inputbox auf '*' password := encode(inputbox(ACaption, 'Bitte Passwort eingeben', ''), inttostr(zufall)); if password = '' then ask4pwd := false else ask4pwd := true;
Delphi-Quellcode:
Wenn ich nur encode() in dem FormCreate Event aufrufe, kommt die Exception immer noch,
function TForm1.Encode(text, pwd:string):string;
var Cipher:TCipher_Blowfish; begin Cipher := TCipher_Blowfish.Create(pwd, nil); Encode := Cipher.EncodeString(text); Cipher.Destroy; end; wenn ich hingegen die ganze "Passwort abfrage" Funktion im FormCreate Event aufrufe, kommt die Excpetion nicht mehr. Was mache ich also in dieser Funktion, dass die Exception verhindert??? :gruebel: MfG der verwirrte Daniel :roll: |
Re: call Iinit() - DEC
OMG, ich habs gefunden... password ist doppelt belegt, das gibts in Hagens DEC und in meiner Unit. Ganz offensichtlich wird an der variable password überprüft, ob die Initialiesierung schon erfolgt ist.
Wieso funzt es dann aber trotzdem??? hmm... |
Alle Zeitangaben in WEZ +1. Es ist jetzt 13:55 Uhr. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024 by Thomas Breitkreuz