How to create instance of Application

P

Peter

Hi,

I have installed Office 2003 and
I try following code placed in external application (not Outlook add-in
dll):

##import "e:\Program Files\Common Files\Microsoft Shared\Office11\mso.dll"
rename_namespace("Office") named_guids, rename("DocumentProperties",
"DocProps" ), raw_interfaces_only, rename("RGB", "OfficeRGB")
#import "f:\Program Files\Microsoft Office\Office11\msoutl.olb"
rename_namespace("Outlook"), exclude("_IRecipientControl",
"_DRecipientControl"), raw_interfaces_only, rename("CopyFile",
"OutlookCopyFile")

Outlook::_ApplicationPtr appPtr = NULL;

hr = appPtr.CreateInstance(__uuidof(Outlook::_Application ));

Result is 0x80040154 (Class not registered)
What is wrong with my code ?

Thanks !
Peter
 
F

Fredrik Wahlgren

Peter said:
Hi,

I have installed Office 2003 and
I try following code placed in external application (not Outlook add-in
dll):

##import "e:\Program Files\Common Files\Microsoft Shared\Office11\mso.dll"
rename_namespace("Office") named_guids, rename("DocumentProperties",
"DocProps" ), raw_interfaces_only, rename("RGB", "OfficeRGB")
#import "f:\Program Files\Microsoft Office\Office11\msoutl.olb"
rename_namespace("Outlook"), exclude("_IRecipientControl",
"_DRecipientControl"), raw_interfaces_only, rename("CopyFile",
"OutlookCopyFile")

Outlook::_ApplicationPtr appPtr = NULL;

hr = appPtr.CreateInstance(__uuidof(Outlook::_Application ));

Result is 0x80040154 (Class not registered)
What is wrong with my code ?

Thanks !
Peter
Hi

I think that there's a dll that's not registered as you try to create an
instance of outlook. It seems as if outlook tries to create instances of
other dll's at this point. Here's a URL that may help;

http://support.microsoft.com/?kbid=270855

If this doesn't work, you may need to reinstall Office.

/ Fredrik
 

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