Problems with CoCreateInstance of Outlook Application object
- From: "Angus Comber" <anguscomber@xxxxxxxxxxxxxxx>
- Date: Sat, 8 Apr 2006 15:02:36 +0100
Hello
I have imported the Outlook 9 files:
#import "C:\Program Files\Microsoft Office2k\Office\mso9.dll"
rename_namespace("Office"), named_guids
using namespace Office;
#import "C:\Program Files\Microsoft Office2k\Office\msoutl9.olb"
rename_namespace("Outlook"), named_guids, raw_interfaces_only
using namespace Outlook;
// my Outlook application object
CComPtr<Outlook::_Application> spApp;
Then if I do either:
hr=CoCreateInstance(CLSID_Application, NULL, CLSCTX_ALL, IID__Application,
(void**)&spApp);
or
hr = m_spApp.CoCreateInstance(CLSID_Application, NULL, CLSCTX_ALL);
I get hr of 0x80004002 which means No such interface supported. Why?
I have even seen code samples on the web doing exactly this. If I do
similar in VBA code it works OK.
Eg
Dim MyApp as Outlook.Application
Set MyApp = CreateObject("Outlook.Application")
This works.
Any help would be much appreciated.
Angus
.
- Prev by Date: Re: Register/Unregister a COM
- Next by Date: Several Problems with Attribute handling in ATL with VS2005
- Previous by thread: Register/Unregister a COM
- Next by thread: Several Problems with Attribute handling in ATL with VS2005
- Index(es):
Relevant Pages
|