Re: TidSMTP compent in a thread, in a package.
From: vertuas (vertuas_at_nospamcallistocs.freeserve.co.uk)
Date: 01/06/04
- Next message: Tom de Neef: "Re: Optimization of the source code !"
- Previous message: Duncan Murdoch: "Re: Something that really annoys me in Delphi ..."
- In reply to: Rob Kennedy: "Re: TidSMTP compent in a thread, in a package."
- Next in thread: J French: "Re: TidSMTP compent in a thread, in a package."
- Reply: J French: "Re: TidSMTP compent in a thread, in a package."
- Reply: Rob Kennedy: "Re: TidSMTP compent in a thread, in a package."
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Tue, 6 Jan 2004 12:32:28 -0000
"Rob Kennedy" <.> wrote in message news:vvkm0ak86qdt6c@corp.supernews.com...
> vertuas wrote:
> > Firstly, i do have FidSMTP:=TidSMTP.create(nil) my mistake when i typed
this
> > posting
>
> The moral: Don't type; copy & paste.
Thanks for that one, another lesson learned.
>
> > Here is my Constructor for my thread
> >
> > constructor TMailerThread.Create(CreateSuspended : boolean);
> > begin
> > inherited create(true);
> > FSettings:=tstringlist.create;
> > FSMTP := TidSMTP.Create(nil);
> >
> > with fsmtp do
> > begin
> > Host:='127.0.0.1';
> > Port:=25;
> > UserName:='vb';
> > end;
> > end;
>
> In a follow-up message, you indicated that there is a TIdMessage object,
> too. Don't you need to create that?
>
The message object IS createed and used in my execute procedure,
> > The statements indie the 'with' are just for basic set up with a local
> > freeware email server.
> >
> > If i comment out the line 'FSMTP:=TidSMTP.Create(nil) then i don't get
the
> > exception.
>
> If you don't create the component at all, then you don't get any
> exceptions? That's very strange.
>
> Again I ask: Where do you get the exception? Which line of code? Please
> post that code.
>
I get the error
Project1.exe has reaised exception class EAccessViolation with message '
Access violation at address 406E6E00 in module 'indy70.bpl'. Read of address
00000000' Process stopped. Use Step or Run to continue.
(Wish i could have copy/pasted that!)
The compiler jump to and highlights the line
FSMTP:=TidSMTP.Create(nil);
Removal of this lin gives
Access Violation at address 00D71D93 in module Mailer.bpl read off address
00000000
the compiler that jumps the the line
Host:='127.0.0.1';
which is underatandable as the TidSMTP wasn't created beecause creation the
line was removed.
> Is it possible that you're freeing FSMTP before you're finished using
> it? Or that you free it twice? Are you doing any pointer operations,
> such as using Move or TStream.Write?
>
Its Create in the Create constructor, it seams to be that the error is
occuring at create of the component
> The exception message for EAccessViolation provides two memory
> addresses. What are they? They can give a clue as to what kind of access
> violation you're experiencing.
>
Access violation at address 406E6E00 in module 'indy70.bpl'. Read of address
00000000
iisn't a read of address 00000000 usally associated with trying to uses
properties or methods of a component that failed to be create?
> > My applictaion IS set to use runtime packages, however I have not added
them
> > to the package list, as my packages, run and work most of the time.
Should
> > i hve added then ??
>
> Your plug-in package should *not* appear in your EXE's package list.
> (Otherwise, it wouldn't be a plug-in anymore.) The Indy package *should*
> appear in your plug-in's "requires" list. Indy should only appear in
> your EXE's package list if your EXE directly uses any of Indy's
facilities.
On this mailer plugin uses the function of the indy component, the main
application does use any network functions at all, that why the mailer
plugin is being written
>
> --
> Rob
I can't thank you enough for all you helping me, at the end of the day its
probaby something sill that i have missed, this is the project i have
worked of with runtime packages and plugins!
Kind regards
Vertuas
- Next message: Tom de Neef: "Re: Optimization of the source code !"
- Previous message: Duncan Murdoch: "Re: Something that really annoys me in Delphi ..."
- In reply to: Rob Kennedy: "Re: TidSMTP compent in a thread, in a package."
- Next in thread: J French: "Re: TidSMTP compent in a thread, in a package."
- Reply: J French: "Re: TidSMTP compent in a thread, in a package."
- Reply: Rob Kennedy: "Re: TidSMTP compent in a thread, in a package."
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|
|