Eric Lajeunesse
Guest
|
Posted:
Mon Sep 12, 2005 11:53 pm Post subject:
SMTP Transport event sink problem (Exchange 2000) |
|
|
Hi all,
I'm working with a transport event sink for a while and now my sink is
working find when I register it and don't restart my the computer all goes
well, I process all incoming and outgoing email normally.
The problem arise when I restart my computer. When the computer is
restarting, my sink is already registred in the Seo database so when there is
some incoming or outcoming email the InetInfo process create automaticaly an
instance of my event sink class and my DLL is loaded in the proccess
InetInfo. After the constructor, the event sink dispather call my
OnMessageSubmission function and I process the email and return normally.
This is the normal and supossed way that should always work. Nevertheless,
when restarting the computer, sometimes two instances of my COM class is
created and make my aplication crashhh :( .. and I really don't figure why
this happen. I don't understand why the dispacher is trying to construct two
instances of my COM class.
any helps will be apreciate
Eric
|
|
cho
Guest
|
Posted:
Thu Sep 15, 2005 12:28 am Post subject:
Re: SMTP Transport event sink problem (Exchange 2000) |
|
|
You need to implement IsCachable() function so that only one sink
instance will be created.
The Technical articals: Microsoft Windows 2000 SMTP Service Events has
the following explaination about IsCachable():
If implemented, this indicates to the dispatcher that it can call your
sink multiple times in a row without having to tear it down. If not
defined, the sink instance is deleted after exit. If this method is not
implemented, indicating that the sink must not be called multiple
times, CoCreateInstance( ) must be called for each event raised which
will reduce performance. In order to implement this, the sink must be
re-entrant/thread-safe. There can be no shared data without proper
locking. This method can be implemented by both transport events and
protocol events. |
|