can't initialise outlook

A

AlexD

I do this code:
Outlook::_ApplicationPtr m_outlookApp =
Outlook::_ApplicationPtr("Outlook.Application");
if( (bool)m_outlookApp )
{
Outlook::_NameSpacePtr m_nameSpace = m_outlookApp->GetNamespace("MAPI");
bool rc = ((bool)m_nameSpace);
if(!rc)
MessageBox(_T("Wrong MAPI"));
}
else
MessageBox(_T("Wrong Outlook.Application"));

MessageBox(_T("OK"));

if I do it when outlook switch off - I get "OK"
but if I turn on outlook - I get "Wrong Outlook.Application"

what can be wrong?
Thanks.
 
R

Roady [MVP]

Better ask in one of the developer newsgroups down the hall.
They all start with outlook.program_
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top