0

Hi i got an application that uses the mso.dll and MSOUTL.OLB :

#pragma warning(disable: 4146)

#import "C:\Program Files\Common Files\Microsoft Shared\Office10\\mso.dll" named_guids

#pragma warning(default: 4146)

#import "C:\Program Files\Microsoft Office\Office10\MSOUTL.OLB" no_namespace exclude("_IRecipientControl", "_DRecipientControl")

In which I'm trying to create an instance of the "Outlook.Application" in the following way:

_ApplicationPtr vApplicationPtr;

HRESULT  vHRESULT = vApplicationPtr.CreateInstance("Outlook.Application");

if (FAILED(vHRESULT))
{
  return;
}
...

This does work fine for me in various Windows and various Office versions, but even if it works in a specific Windows with an Office it might not work on another pc with the exact same Windows and the exact Office... what could be the reasons that it enters the "if (FAILED(vHRESULT))" block?

2
Contributors
1
Reply
2
Views
9 Years
Discussion Span
Last Post by Salem
0

I'd be surprised if there wasn't some "getlasterror" function you could call to find out more.

Perhaps you should read the manual on CreateInstance, look to see how it returns additional error information, then use that in your program.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.