Article View: borland.public.cppbuilder.internet.socket
Article #3320EAccessViolation with TIdHashMessageDigest5
From: Devon Harbaugh
Date: Thu, 13 Oct 2005 18:40
Date: Thu, 13 Oct 2005 18:40
25 lines
1987 bytes
1987 bytes
I'm trying to use TIdHashMessageDigest5, but whenever I call the
HashValue function, regardless of whether I send in a TStream* or an
AnsiString, an EAccessViolation exception is thrown. I've not been able
to figure out what's wrong with my code. I've included a sample of what
I've tried so far and would appreciated any suggestions you may have.
Devon Harbaugh
...
#include <IdHashMessageDigest.hpp>
...
void __fastcall TForm1::Button1Click(TObject* Sender) {
TFileStream* File = NULL;
TIdHashMessageDigest5* Hash = NULL;
try {
File = new TFileStream("c:\\boot.ini", fmOpenRead);
Hash = new TIdHashMessageDigest5;
Edit1->Text = Hash->HashValue(File);
} catch(Exception& Ex) {
Edit1->Text = Ex.Message;
}
if(Hash) delete Hash;
if(File) delete File;
}
...
Technical Details
Message-ID:
<434ea979$1@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!g2news1.google.com!news3.google.com!border1.nntp.dca.giganews.com!border2.nntp.dca.giganews.com!nntp.giganews.com!novia!newsfeed.yul.equant.net!news-out.nuthinbutnews.com!propagator2-sterling.newsfeeds.com!in.nntp.be!caladan.landsraad.net!newsgroups.borland.com!not-for-mailShow Full Headers
Complete Article Headers
X-Google-Thread: 11508e,c548c5d803c719e2,start X-Google-Attributes: gid11508e,public X-Google-Language: ENGLISH,ASCII-7-bit Reply-To: "Devon Harbaugh" <dharbaugh@laptopsetc.com> From: "Devon Harbaugh" <dharbaugh@laptopsetc.com> Newsgroups: borland.public.cppbuilder.internet.socket Subject: EAccessViolation with TIdHashMessageDigest5 Date: Thu, 13 Oct 2005 12:40:32 -0600 Lines: 26 Organization: Business Technologies Inc. MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2800.1506 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1506 NNTP-Posting-Host: 71.35.255.70 Message-ID: <434ea979$1@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1129228665 71.35.255.70 (13 Oct 2005 11:37:45 -0700) Path: arc1-ca.pugleaf.net!g2news1.google.com!news3.google.com!border1.nntp.dca.giganews.com!border2.nntp.dca.giganews.com!nntp.giganews.com!novia!newsfeed.yul.equant.net!news-out.nuthinbutnews.com!propagator2-sterling.newsfeeds.com!in.nntp.be!caladan.landsraad.net!newsgroups.borland.com!not-for-mail