Welcome to MSDN Blogs Sign in | Join | Help

Updated MSLMS Sample Posted

A while back, I posted an article about the fixes Jason and I had to make to the MSLMS sample message store to get it to load under Outlook 2003. Since then, I've received numerous requests that I post the changes. I wasn't ignoring the requests - I've just been busy adding features to MFCMAPI (more on that later).

Before I posted the code, I wanted to scrub it once more for obvious defects. We have some tools here which can point out potential bugs in your code, like dereferencing a pointer without first checking that it's not NULL. I was amazed at the volume of errors these scripts found in the sample. Even though most of these errors were trivial to fix, the number of them made for slow goings.

Anyway, here's the updated code. Fair warning: There's no warrenty whatsoever implied in this code. USE THIS CODE AT YOUR OWN RISK!

Todo list:

  • Scrub each individual function for coding errors - make sure all parameters are checked and all variables properly initialized
  • Remove all old tracing code and replace it with something more modern
  • Remove all code wrapped in assert/verify macros and replace with real error handling
  • Remove all gotos
  • Remove dead code
  • Add error handling for all function calls
  • Replace all string handling functions with equivalent StrSafe functions
  • Revisit my fix for the heap management issues

I'll post updates as I make major changes and bug fixes. I may create a workspace for this on gotdotnet if I see enough interest in it. Until I do, send any bug reports to me.

[edit - crediting JasonJoh for the work he did on this]

[Update – This sample is now part of the Outlook MAPI Code Samples on Codeplex!]

Published Thursday, September 30, 2004 5:18 PM by Stephen Griffin

Comments

# re: Updated MSLMS Sample Posted

I've found some additional errors in the posted sample.
And there is a big leak of functionality as a default Store: It can't send mail via spooler. May be it's better to say that spooler suppopt is not completed.
Another leak is Search Folders.

Monday, October 04, 2004 3:46 AM by Henry Ghusakovsky

# re: Updated MSLMS Sample Posted

My goal was to get the existing sample working, not to add new features. Search folders was never implemented in MSLMS.

On sending mail - I don't think MSLMS ever supported being the default store provider - I did some tests enabling it and the first roadblock I hit was when Outlook tries to store special folder entry IDs on the Inbox - CMAPIFolder::SetProps doesn't allow for arbitrary props on folders. That problem is fixable, but leads into a second problem - we can't create a Reminders folder since MSLMS doesn't support search folders.

I'm not sure I follow the spooler comment - given that the MSLMS sample has never supported being a default store, how would we expect it to 'send mail via the spooler'?
Monday, October 04, 2004 11:48 AM by Stephen Griffin

# re: Updated MSLMS Sample Posted

I have fixed spooler problems and fixed a number of memory corrupting errors.
Added another missing property in the Hierarchy tables.
Allowed setting custom properties for folders.
Fixed updating Content Tables (there was an error if some open properties present)
Now it works better in my Outlook XP.
So i can send you an updated project.
Monday, October 04, 2004 5:05 PM by Henry Ghusakovsky

# re: Updated MSLMS Sample Posted

Much appreciated - send me a mail via the contact link and we'll coordinate from there.
Monday, October 04, 2004 5:12 PM by Stephen Griffin

# re: Updated MSLMS Sample Posted

" I have fixed spooler problems and fixed a number of memory corrupting errors. "

Any chance I can download the latest and greatest of the MSLMS?

thanks in advance.
Wednesday, October 13, 2004 1:13 PM by Peter Lepeska

# re: Updated MSLMS Sample Posted

I had some issues integrating Henry's changes to the existing code - lot's of memory corruption. I don't know yet if it's his changes or the way I integrated them or some combination of the two.

Rather than rush through it and end up with an unstable build, I'm taking my time with this integration - unfortunately, I'm also very busy with some other projects so it may be a while before I post a new updated sample.
Wednesday, October 13, 2004 1:21 PM by Stephen Griffin

# re: Updated MSLMS Sample Posted

Looking forward to the next stable build...
Monday, October 25, 2004 11:27 AM by Gwyn Cole

# re: Updated MSLMS Sample Posted

hi dear Stephen.
is it possible to compile you'r mslms sample in microsoft visual studio.net.
i looking for .net samples and i found nothing, for writing store provider.
is it any resource or sources that lead me.
thanks
Wednesday, January 04, 2006 9:18 AM by mehdi

# re: Updated MSLMS Sample Posted

If by .Net you mean Visual Studio 2003/2005 unmanaged C++, then it should probably work, barring a few minor issues any project would have porting from one compiler to another.

If by .Net you mean managed code like C# or managed C++, then that would fall into the category of mixing MAPI and managed code, which is a no-no.
Friday, January 06, 2006 10:35 AM by Stephen Griffin

# Outlook 2003 Integration API Wrapped PST Docs and Sample

Documentation and sample for a Wrapped PST

Tuesday, October 03, 2006 3:37 PM by SGriffin's [MSFT] WebLog
New Comments to this post are disabled
 
Page view tracker