Solved

simple MAPI help

Posted on 2002-07-09
17
677 Views
Last Modified: 2009-07-29
First, I am not sure if I want to use MAPI
but, I do know what I need to do.

I am working on a pretty basic email client.
It will support attachments (send & recieve)
and html send and recieve
that's really about it, I don't need an address book or anything else fancy than that.


HOWEVER,
I am stuck because it appears there is problem using MAPI becuase it does not work with outlook express.

I am really trying to get away from using Outlook.

I need your advice and recommendations on which way to procede.

I am not a very knowledgeable C++ programmer.

so trying to decode MIME and parse the emails could be time consuming.

basically, I am trying to replace ACT! email because it is woefully inadequate ( no html, bad attachment supt).  I don't want any of it's same shortcommings, so I want a quick and reliable method of going about this, that will work on the 100+ computers at our company ...all in the same way...

I would really like it to work without outlook or outlook express, or at least, be version independent.

I read through pretty much all your posts about MAPI, and it does say that Simple MAPI can communicate with outlook express, but I downloaded the sample from MS website, and it only works for me with outlook, not outlook express.

Thanks so much,

Bob

0
Comment
Question by:bebonham
17 Comments
 
LVL 30

Expert Comment

by:Axter
ID: 7141223
>> it only works for me with outlook, not outlook express.

What exactly happens when you try to use it with outlook express?

When you try to use it with Outlook Express, do you have Outlook Express setup as your default email program?
0
 
LVL 8

Author Comment

by:bebonham
ID: 7141393
It gives me errors...

Microsoft Outlook pops up a message and says

"Either there is no default mail client or the current mail client cannot fulfill the messaging request.  Please run Microsoft Outlook and set it as the default mail client."

this msg box has a title of "Microsoft Outlook" so that is why I say outlook is poping it up, not the ms. sample program.

(also that msg box text is not in the m.s. .h and .cpp files)

so...it seems Outlook may be doing something...I don't know...

then if I try and create a message or read a message from my inbox, it crashes.


Bob

0
 
LVL 30

Expert Comment

by:Axter
ID: 7141413
Before running the program, first conduct the following test.
Open a program like MS Word or MS Excel.
Create or open a document.
Try to mail the document FROM THE APPLICATION.
This can be done by clicking on the main menu FILE->[Send-To]->[Mail-Recipient]

If Outlook Express starts up, then you do have Outlook Express setup right.

If Outlook Express does NOT start up, then you don't have Outlook Express setup as your email program, and that is where you're problem is at.  It's not the code that is the problem.
0
 
LVL 30

Expert Comment

by:Axter
ID: 7141423
If the above test proves Outlook Express is setup right, can you please post your MAPI code?
0
 
LVL 8

Author Comment

by:bebonham
ID: 7141550
I am only using the compiled EXE that I downloaded from MS website.

I am having trouble getting the actuall cpp and .h files to compile I have the error

"c:\cpptests\st\swap.cpp(1286) : fatal error C1010: unexpected end of file while looking for precompiled header directive"


this is happening in a mfc dialog project...
I have added swap.cpp and swap.h to the project and then I added this one function to my dialog:

void CStDlg::OnOK()
{
lpCApp pCApp = NULL;     // Global application object



     HRESULT hRes = S_OK;
     int          lpMenuChoice;   // Selection made by the user
     int          nNotDone = 0;     // Determined when to quit control loop.
     
     pCApp = new ( CApp );    
//     CDialog::OnOK();
}


I will post the microsoft code if you like, but you can also download it from there website here:

http://support.microsoft.com/default.aspx?scid=kb;EN-US;q171096&GSSNB=1


thanks,

Bob

0
 
LVL 8

Author Comment

by:bebonham
ID: 7141552
also the test w/ excel spreadsheet shows outlook express as the default client
0
 
LVL 8

Author Comment

by:bebonham
ID: 7141638
now I only have these errors preventing compilation

swap.obj : error LNK2001: unresolved external symbol _MAPIUninitialize@0
swap.obj : error LNK2001: unresolved external symbol _MAPIAllocateBuffer@8
swap.obj : error LNK2001: unresolved external symbol _MAPIInitialize@4
swap.obj : error LNK2001: unresolved external symbol _MAPIFreeBuffer@4
Debug/st.exe : fatal error LNK1120: 4 unresolved externals
0
 
LVL 30

Expert Comment

by:Axter
ID: 7141650
Do you have the most current SDK loaded on your computer?
0
IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 
LVL 30

Expert Comment

by:Axter
ID: 7141654
To me, it looks like you don't have the most current SDK loaded.
You can update your SDK via the following link:
http://www.microsoft.com/msdownload/platformsdk/sdkupdate/
0
 
LVL 8

Author Comment

by:bebonham
ID: 7141706
okay I resolved those problems I was having, and it is now compileing, but still have same problem with the outlook message popping up as before I will d/l sdk it looks like it will take a while at ~=300 meg

I will keep playing with this though.

Thanks, I will get back as soon as d/l completes.

Bob
0
 
LVL 8

Author Comment

by:bebonham
ID: 7144179
Hi Axter,

well, I changed over the MS sample from being printf to afxmessagebox for my debugging, and for some reason it seems to work so far (only tested reading message subjects from outlook express in box)

it also could have been the SDK's that fixed it, because I didn't get it working untill after I d/l them.

I will keep this q. open for one more day (incase I run in to problems with the MAPI) but I will award points for your help tomorow.

as always thanks for your help

Bob
0
 
LVL 30

Accepted Solution

by:
Axter earned 400 total points
ID: 7144200
>>as always thanks for your help

Any time.
0
 
LVL 1

Expert Comment

by:Ilia
ID: 7201084
Hi,
If You want to work only with Outlook (not Express), I have a one trick how to do this. This is a change of registry settings...

If you are interesting, please ask me by e-mail maito:igolubev@entopia.com.
0
 
LVL 30

Assisted Solution

by:Axter
Axter earned 400 total points
ID: 7201128
Posting my previous comments as answer
0
 
LVL 8

Author Comment

by:bebonham
ID: 7201134
wow,  sorry I left this open so long!!!
0
 
LVL 30

Expert Comment

by:Axter
ID: 7201148
No problem.  I forgot about it myself, until Ilia posted a comment.
0
 
LVL 5

Expert Comment

by:Netminder
ID: 7201291
Proposed answer rejected; this SHOULD close the question.

Netminder
CS Moderator
0

Featured Post

Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

  Included as part of the C++ Standard Template Library (STL) is a collection of generic containers. Each of these containers serves a different purpose and has different pros and cons. It is often difficult to decide which container to use and …
Basic understanding on "OO- Object Orientation" is needed for designing a logical solution to solve a problem. Basic OOAD is a prerequisite for a coder to ensure that they follow the basic design of OO. This would help developers to understand the b…
The goal of the video will be to teach the user the difference and consequence of passing data by value vs passing data by reference in C++. An example of passing data by value as well as an example of passing data by reference will be be given. Bot…
The viewer will learn how to use the return statement in functions in C++. The video will also teach the user how to pass data to a function and have the function return data back for further processing.

743 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now