Events not firing under on Import... 
Author Message
 Events not firing under on Import...

I have an OL2K AddIn written in VB which traps the ItemAdd() event (among
others).  This works fine when a user adds a single item to a folder or when
I copy and paste a small number of items.  However, if I import more than 16
items into a given folder, the ItemAdd() event never fires.  Is this by
design?  If it is NOT by design, then what am I doing wrong, or
alternatively, is there a way to enable the events no matter how many items
are imported or copied to a folder.

If this error is somehow caused by my own code and I find out what the bug
is, I will update this post myself.  However, initial inspection tells me
that the error is not in the ItemAdd() or supporting code, though I would
like to be proven wrong on this one.

Patrick.



Fri, 16 May 2003 03:00:00 GMT  
 Events not firing under on Import...
Patrick, does OutlookSpy (see the link below) exhibit the same behavior when you
import new items ("Folder" button - select "Items", click "Browse", "Events"
tab)? Do events fire on the Extended MAPI level (IMAPIFolder - IMsgStore::Advise
and IMAPIFolder - Contents - Notifications Log)?
I am curious if there is any difference in notifications between Extended MAPI
(which should always work) and Outlook Object Model notifications (based on
Extended MAPI but subject to bugs/limitations/etc).

Dmitry Streblechenko
http://www.dimastr.com/
OutlookSpy  - Outlook, CDO
and MAPI Developer Tool


Quote:
> I have an OL2K AddIn written in VB which traps the ItemAdd() event (among
> others).  This works fine when a user adds a single item to a folder or when
> I copy and paste a small number of items.  However, if I import more than 16
> items into a given folder, the ItemAdd() event never fires.  Is this by
> design?  If it is NOT by design, then what am I doing wrong, or
> alternatively, is there a way to enable the events no matter how many items
> are imported or copied to a folder.

> If this error is somehow caused by my own code and I find out what the bug
> is, I will update this post myself.  However, initial inspection tells me
> that the error is not in the ItemAdd() or supporting code, though I would
> like to be proven wrong on this one.

> Patrick.



Sat, 17 May 2003 03:00:00 GMT  
 Events not firing under on Import...
Dmitry,

much appreciate the SPY reference - I am out of the office for today but
will try this tonight and report back my findings.

Patrick.


Quote:
> Patrick, does OutlookSpy (see the link below) exhibit the same behavior
when you
> import new items ("Folder" button - select "Items", click "Browse",
"Events"
> tab)? Do events fire on the Extended MAPI level (IMAPIFolder -
IMsgStore::Advise
> and IMAPIFolder - Contents - Notifications Log)?
> I am curious if there is any difference in notifications between Extended
MAPI
> (which should always work) and Outlook Object Model notifications (based
on
> Extended MAPI but subject to bugs/limitations/etc).

> Dmitry Streblechenko
> http://www.dimastr.com/
> OutlookSpy  - Outlook, CDO
> and MAPI Developer Tool



Sat, 17 May 2003 03:00:00 GMT  
 Events not firing under on Import...

Dimitry,

when I Import N items into a given folder (N <= 16) then
IMAPIFolder->Contents->Notifications Log displays data for N "ulEventType:
fnevTableModified" blocks.

However, if I import M items into a given folder (M >= 17) then all I see is
the following:

ulEventType: fnevTableModified
 tab.ulTableEvent: TABLE_CHANGED
 tab.propIndex: (0x0000, ???
 tab.propPrior: (0x0000, ???)
 tab.row: (cValues : 0
 )

So, in the first case I see 16 entries in the log, and in the second case I
see only one.

In fact, I only see one entry when I delete everything from a given folder;
that is, any action that results in an empty folder never fires the
ItemRemove() event, and this *feature* appears to be mirrored in the
underlying MAPI event.

Patrick.


Quote:
> Patrick, does OutlookSpy (see the link below) exhibit the same behavior
when you
> import new items ("Folder" button - select "Items", click "Browse",
"Events"
> tab)? Do events fire on the Extended MAPI level (IMAPIFolder -
IMsgStore::Advise
> and IMAPIFolder - Contents - Notifications Log)?
> I am curious if there is any difference in notifications between Extended
MAPI
> (which should always work) and Outlook Object Model notifications (based
on
> Extended MAPI but subject to bugs/limitations/etc).

> Dmitry Streblechenko
> http://www.dimastr.com/
> OutlookSpy  - Outlook, CDO
> and MAPI Developer Tool



Sat, 17 May 2003 03:00:00 GMT  
 Events not firing under on Import...
There is a KB article on the known problem with ItemAdd() not firing
consistently when large numbers of items are adding.

--
Sue Mosher
Author of
  "Teach Yourself Microsoft Outlook 2000 Programming in 24 Hours"
  "Microsoft Outlook 2000 E-mail and Fax Guide"

Outlook and Exchange solutions at http://www.slipstick.com


Quote:
> I have an OL2K AddIn written in VB which traps the ItemAdd() event (among
> others).  This works fine when a user adds a single item to a folder or
when
> I copy and paste a small number of items.  However, if I import more than
16
> items into a given folder, the ItemAdd() event never fires.  Is this by
> design?  If it is NOT by design, then what am I doing wrong, or
> alternatively, is there a way to enable the events no matter how many
items
> are imported or copied to a folder.

> If this error is somehow caused by my own code and I find out what the bug
> is, I will update this post myself.  However, initial inspection tells me
> that the error is not in the ItemAdd() or supporting code, though I would
> like to be proven wrong on this one.

> Patrick.



Sun, 18 May 2003 03:00:00 GMT  
 Events not firing under on Import...
Thanks Sue.

Microsoft's claim that the number is large is questionable, since I used a
very minimal appointmentItem and could only manage to import 16 before the
problem showed itself.  The KB article also claims that it depends on the
size of the item being added, which implies that for these types of items 16
is close to the maximum.

The workaround they suggest that is most relevant to my setup is the same
workaround I have put in place, but there are potential race conditions.
All in all, the AddIn I have built requires more code for workarounds than
for the core business application logic.  The workaround code is also the
most complicated, since it is, in a sense, artificial, and therefore
requires considerable documentation to support it.

These comments are informational, and intended for the eyes of MS; your
help, and that of all contributors here is invaluable and very much
appreciated.

Patrick.



Quote:
> There is a KB article on the known problem with ItemAdd() not firing
> consistently when large numbers of items are adding.

> --
> Sue Mosher
> Author of
>   "Teach Yourself Microsoft Outlook 2000 Programming in 24 Hours"
>   "Microsoft Outlook 2000 E-mail and Fax Guide"

> Outlook and Exchange solutions at http://www.slipstick.com



Sun, 18 May 2003 03:00:00 GMT  
 Events not firing under on Import...
That pretty much means you are out of luck: MAPI says that there were too many
changes to report each one separately. This can still be worked around in
Extended MAPI, but with Outlook Object Model only you are out of luck I am
afraid... Sorry.

Dmitry Streblechenko
http://www.dimastr.com/
OutlookSpy  - Outlook, CDO
and MAPI Developer Tool


Quote:
> Dimitry,

> when I Import N items into a given folder (N <= 16) then
> IMAPIFolder->Contents->Notifications Log displays data for N "ulEventType:
> fnevTableModified" blocks.

> However, if I import M items into a given folder (M >= 17) then all I see is
> the following:

> ulEventType: fnevTableModified
>  tab.ulTableEvent: TABLE_CHANGED
>  tab.propIndex: (0x0000, ???
>  tab.propPrior: (0x0000, ???)
>  tab.row: (cValues : 0
>  )

> So, in the first case I see 16 entries in the log, and in the second case I
> see only one.

> In fact, I only see one entry when I delete everything from a given folder;
> that is, any action that results in an empty folder never fires the
> ItemRemove() event, and this *feature* appears to be mirrored in the
> underlying MAPI event.

> Patrick.



> > Patrick, does OutlookSpy (see the link below) exhibit the same behavior
> when you
> > import new items ("Folder" button - select "Items", click "Browse",
> "Events"
> > tab)? Do events fire on the Extended MAPI level (IMAPIFolder -
> IMsgStore::Advise
> > and IMAPIFolder - Contents - Notifications Log)?
> > I am curious if there is any difference in notifications between Extended
> MAPI
> > (which should always work) and Outlook Object Model notifications (based
> on
> > Extended MAPI but subject to bugs/limitations/etc).

> > Dmitry Streblechenko
> > http://www.dimastr.com/
> > OutlookSpy  - Outlook, CDO
> > and MAPI Developer Tool



Sun, 18 May 2003 03:00:00 GMT  
 Events not firing under on Import...
Dmitry,

X-MAPI is fine with me, if that provides a solution that does not have to be
ready tomorrow.  The Outlook AddIn is a prototype app for now, so with that
in mind, what is the best approach to learning/writing X-MAPI apps?

Are we looking at DLLs, COM DLLs, COM Servers, ...?  What are the available
languages for writing such applications, by which I mean: what is the best
trade-off of functionality vs. complexity.  From what I have read on this
NG, you write in Delphi and C++?

Regards,

Patrick.


Quote:
> That pretty much means you are out of luck: MAPI says that there were too
many
> changes to report each one separately. This can still be worked around in
> Extended MAPI, but with Outlook Object Model only you are out of luck I am
> afraid... Sorry.

> Dmitry Streblechenko
> http://www.dimastr.com/
> OutlookSpy  - Outlook, CDO
> and MAPI Developer Tool



Sun, 18 May 2003 03:00:00 GMT  
 Events not firing under on Import...
The only available languages are C++ and Delphi. Both are great for X-MAPI
development, so the choice is mostly based on whether you already had any
previous experience with either one. Either choice is fine as long as you stay
at the low level. If you however plan to have UI, Delphi has a clear advantage:
MFC doesn't even come close to VCL in terms of usability and ease of use. Many
people use VC++ for low level and VB for UI, but that means you have to be
proficient in both languages and also brings a whole new level of complexity.
Another advantage is Delphi's handling of late bound COM: very similar to VB,
but unlike VB, Delphi can also go low level just like VC++.
MS provides X-MAPI headers for C++ only, but Delphi translations are available
on the net. Let me know if you need them.
Oops, I forgot another compiler: Borland C++ Builder. You can use all VC++
X-MAPI headers and MS sample code without any changes, but you can write UI
using VCL, not MFC.

Dmitry Streblechenko
http://www.dimastr.com/
OutlookSpy  - Outlook, CDO
and MAPI Developer Tool


Quote:
> Dmitry,

> X-MAPI is fine with me, if that provides a solution that does not have to be
> ready tomorrow.  The Outlook AddIn is a prototype app for now, so with that
> in mind, what is the best approach to learning/writing X-MAPI apps?

> Are we looking at DLLs, COM DLLs, COM Servers, ...?  What are the available
> languages for writing such applications, by which I mean: what is the best
> trade-off of functionality vs. complexity.  From what I have read on this
> NG, you write in Delphi and C++?

> Regards,

> Patrick.



> > That pretty much means you are out of luck: MAPI says that there were too
> many
> > changes to report each one separately. This can still be worked around in
> > Extended MAPI, but with Outlook Object Model only you are out of luck I am
> > afraid... Sorry.

> > Dmitry Streblechenko
> > http://www.dimastr.com/
> > OutlookSpy  - Outlook, CDO
> > and MAPI Developer Tool



Mon, 19 May 2003 03:00:00 GMT  
 Events not firing under on Import...
Dmitry,

does C++ Builder handle late bound COM like VB?  VB and VC I am familiar
with.  Delphi I have avoided for the commonly recorded reason - Object
Pascal.  I am not religiously bound to a given language, and I have
programmed in Pascal many years ago (for many years), so you're telling me
that Delphi is the optimal solution, all other things being equal?

You say that doing the low-level work in VC and UI in VB is more complex...
due to what?  Due to the need to map data structures from VC into VB and/or
COM marshalling issues or just simple proficiency requirements?

OK.  Assume I have decided on a language or languages.  Where then is the
best place to begin learning and using X-MAPI?  Is there a tutorial you
recommend or a textbook?  What about MSDN resources (I will looked myself
also...)

Much appreciate the detailed feedback..

Patrick.


Quote:
> The only available languages are C++ and Delphi. Both are great for X-MAPI
> development, so the choice is mostly based on whether you already had any
> previous experience with either one. Either choice is fine as long as you
stay
> at the low level. If you however plan to have UI, Delphi has a clear
advantage:
> MFC doesn't even come close to VCL in terms of usability and ease of use.
Many
> people use VC++ for low level and VB for UI, but that means you have to be
> proficient in both languages and also brings a whole new level of
complexity.
> Another advantage is Delphi's handling of late bound COM: very similar to
VB,
> but unlike VB, Delphi can also go low level just like VC++.
> MS provides X-MAPI headers for C++ only, but Delphi translations are
available
> on the net. Let me know if you need them.
> Oops, I forgot another compiler: Borland C++ Builder. You can use all VC++
> X-MAPI headers and MS sample code without any changes, but you can write
UI
> using VCL, not MFC.

> Dmitry Streblechenko
> http://www.dimastr.com/
> OutlookSpy  - Outlook, CDO
> and MAPI Developer Tool



Mon, 19 May 2003 03:00:00 GMT  
 Events not firing under on Import...
Yes, C++ Builder handles late bound COM just like Delphi and VB. Delphi example:

var SomeObject : OleVariant;
...
SomeObject.SomeMethod(Param);

and just like VB it implicitly calls GetIDsOfNames()/Invoke() and just like VC++
you can opt to call these methods explicitly if you want.
Delphi is much more than old good Pascal many of us studied in college. Its OO
model is very close to C++, in fact it is very similar to C# - no suprise here
since the guy at Borland (Anders Hejlberg) who designed Delphi now works for
Microsoft on C#. The difference is Delphi and CPPB (unlike C#) produce natively
compiled code and (unlike VB) do not rely on any runtime libraries.
C++ Builder shares with Delphi the same library (VCL) and OO extensions
(properties, streaming mechnism, exception handling, etc), so using either one
is a matter of a language preference. I personally prefer Delphi, but C++ is Ok
with me too.
Delphi trial edition is available for download at the Borland site:
http://www.borland.com/delphi/trial5/trialdownload.html
I don't think there is a trial edition of C++ Builder, but its Standard edition
(without VCL source code) is less than $100, but I would recommend Professional
(around $300 upgrade price).
I don't know how important it could be for you (probably not much), but Delphi
and CPPB will be available for Linux early next year (Kylix).
There are literally thousands of freeware and shareware Delphi and CPPB classes
and components on the net. Just to see what is available, look at either
http://www.torry.net (click on "VCL" button) or http://delphi.icm.edu.pl/

Re. combining VC++ and VB: you will have two sets of executables (say, main EXE
and a bunch of COM dlls), so maintaining is much harder. Properly designing from
the very beginning how the two will interact also adds additional complexity.
IMHO using one compiler to produce a single self-containing executable is much
easier to write, debug, maintain and install.

Extended MAPI resources: there aren't many. You already tried MSDN (which is
helpful if you know what exactly you are looking for, say the name of some
flag). Another one (a must for *every* X-MAPI develper) is "Inside MAPI" book.
It's been out of print for several years now, but its electronic (PDF) edition
is available online at http://www.insidemapi.com/

Let me know if you need any additional info. You might also want to try Borland
newsgroups (newsgroups.borland.com) - they are very active and people there will
be more than happy to answer any questions.

Dmitry Streblechenko
http://www.dimastr.com/
OutlookSpy  - Outlook, CDO
and MAPI Developer Tool


Quote:
> Dmitry,

> does C++ Builder handle late bound COM like VB?  VB and VC I am familiar
> with.  Delphi I have avoided for the commonly recorded reason - Object
> Pascal.  I am not religiously bound to a given language, and I have
> programmed in Pascal many years ago (for many years), so you're telling me
> that Delphi is the optimal solution, all other things being equal?

> You say that doing the low-level work in VC and UI in VB is more complex...
> due to what?  Due to the need to map data structures from VC into VB and/or
> COM marshalling issues or just simple proficiency requirements?

> OK.  Assume I have decided on a language or languages.  Where then is the
> best place to begin learning and using X-MAPI?  Is there a tutorial you
> recommend or a textbook?  What about MSDN resources (I will looked myself
> also...)

> Much appreciate the detailed feedback..

> Patrick.



Mon, 19 May 2003 03:00:00 GMT  
 Events not firing under on Import...
Dmitry,

I'm sure this information is useful to lots of folks besides myself.  Much
appreciate the pointers and insights.

I have one comment regarding the object-breakout of an application - the
more I do it, the more I like it - it actually does lead to reuse at the
application level and sharing components with others works once, as you
point out, a confident design is done up front and developers stay in close
communication.  Somewhat like ISR programming, design of what will happen at
the object boundaries is all-important, and if the application resists being
broken up, then broken it should not be.

Depending on how my current client wants to tackle the OOM limitations that
have manifested in the AddIn, X-MAPI might be a part of my future and in any
case, I will download the basic Delphi dev. system simply based on your (and
other developers') enthusiasm for it.

Regards,

Patrick.


Quote:
> Yes, C++ Builder handles late bound COM just like Delphi and VB. Delphi
example:

> var SomeObject : OleVariant;
> ...
> SomeObject.SomeMethod(Param);

> and just like VB it implicitly calls GetIDsOfNames()/Invoke() and just
like VC++
> you can opt to call these methods explicitly if you want.
> Delphi is much more than old good Pascal many of us studied in college.
Its OO
> model is very close to C++, in fact it is very similar to C# - no suprise
here
> since the guy at Borland (Anders Hejlberg) who designed Delphi now works
for
> Microsoft on C#. The difference is Delphi and CPPB (unlike C#) produce
natively
> compiled code and (unlike VB) do not rely on any runtime libraries.
> C++ Builder shares with Delphi the same library (VCL) and OO extensions
> (properties, streaming mechnism, exception handling, etc), so using either
one
> is a matter of a language preference. I personally prefer Delphi, but C++
is Ok
> with me too.
> Delphi trial edition is available for download at the Borland site:
> http://www.borland.com/delphi/trial5/trialdownload.html
> I don't think there is a trial edition of C++ Builder, but its Standard
edition
> (without VCL source code) is less than $100, but I would recommend
Professional
> (around $300 upgrade price).
> I don't know how important it could be for you (probably not much), but
Delphi
> and CPPB will be available for Linux early next year (Kylix).
> There are literally thousands of freeware and shareware Delphi and CPPB
classes
> and components on the net. Just to see what is available, look at either
> http://www.torry.net (click on "VCL" button) or http://delphi.icm.edu.pl/

> Re. combining VC++ and VB: you will have two sets of executables (say,
main EXE
> and a bunch of COM dlls), so maintaining is much harder. Properly
designing from
> the very beginning how the two will interact also adds additional
complexity.
> IMHO using one compiler to produce a single self-containing executable is
much
> easier to write, debug, maintain and install.

> Extended MAPI resources: there aren't many. You already tried MSDN (which
is
> helpful if you know what exactly you are looking for, say the name of some
> flag). Another one (a must for *every* X-MAPI develper) is "Inside MAPI"
book.
> It's been out of print for several years now, but its electronic (PDF)
edition
> is available online at http://www.insidemapi.com/

> Let me know if you need any additional info. You might also want to try
Borland
> newsgroups (newsgroups.borland.com) - they are very active and people
there will
> be more than happy to answer any questions.

> Dmitry Streblechenko
> http://www.dimastr.com/
> OutlookSpy  - Outlook, CDO
> and MAPI Developer Tool



Mon, 19 May 2003 03:00:00 GMT  
 
 [ 12 post ] 

 Relevant Pages 

1. click event not firing if lost_focus is firing first

2. ReadProperties event and WriteProperties event are not firing

3. Control Event Problem (Post Event after an event is fired)

4. Terminate Event not Fired

5. BeforeDelConfirm, AfterDelConfirm events not firing

6. Inspector_Close Event Not Firing

7. Outlook 2000 Add-in : Disconnect events do not fire

8. Event does not fire after showing a form

9. Form events not firing in public folder

10. Reply Inspector not firing terminate event???

11. CheckBox events not firing?

12. Click-Event does not fire

 

 
Powered by phpBB® Forum Software