Invalid Pointer connecting to Outlook Application using automation

T

TroySupport

Hi,

We have been stuck on this particular problem for a few days so any help
would be gratefully received. We have a win32 application developed in C++
using Visual Studio 6 which succesfully connects to Outlook on hundreds of
sites. However we have one particular site where the application is unable to
connect to Outlook.


The site has 3 workstations running Office 2003 SP3 on windows XP and they
all throw an exception "Invalid Pointer" when trying to connect to the
Outlook.Application namespace. The snippet of code is below. The commented
out piece of code is the original code that is being used for all of our
clients. Have tried both on the affected site to no avail.

try
{
hResult = pApp.CreateInstance( __uuidof(Application) ) ;
//hResult = pApp.CreateInstance( "Outlook.Application" ) ;
Name = pApp->GetNamespace( L"MAPI" ) ;
}

Are there any security settings within XP or Outlook that would stop this
working? We have already tried re-installing Office, once again with no luck.

If anyone out there in MSDN land has any ideas we would be very grateful.



Many Thanks



Troy Support
 
K

Ken Slovak - [MVP - Outlook]

Are the computers at that site running any anti-virus software that includes
a script stopper or some other software such as a firewall that includes a
script stopper? It's possible something like that could be preventing your
creation of an Outlook.Application object using code.
 
T

TroySupport

Hi Ken,

Thank you for your response.

I have switched off both the firewall (Microsoft) and the anti-virus (AVG
8.0) without any success. Are there any other security settings which may
have a similar effect?
 
K

Ken Slovak - [MVP - Outlook]

This is a standalone application and not a COM addin, correct?

See if at this site the users are running any managed code addins. If they
are see if the problem goes away if any managed code addins are temporarily
disabled.

Also see if they are running synch software for PDA's or other devices or
something like Skype, that integrates with Outlook. Again, see if things are
working if any of that software is disabled.

I'm afraid it's going to take some detective work on your part.
 
T

TroySupport

Hi Ken,

Yes this is a standalone application.

Okay, will dust off the deerstalker and pipe. Thanks.
 
T

TroySupport

They are running :-

Business Contact Manager for Outlook
AVG 8.0.138
Outlook Backup Admin (COM Addin)
AVG Exchange Extension (Addin)
Exchange Extension Property Pages (Addin)

Would any one these cause problems connecting to the Outlook.Application
name space?
 
K

Ken Slovak - [MVP - Outlook]

Exchange Property Pages extension probably is not the problem, almost all
systems have that.

For the others you should disable them all and then see if the problem
disappears. If it does then re-enable the addins one at a time until the
problem happens again. Then you have a suspect.
 
T

TroySupport

Hi Ken,

Finally got it working. Removed the Office 2007 Interop Assemblies which had
never been used from the Add/Remove programs option and then it worked.

Thanks for your help
 
K

Ken Slovak - [MVP - Outlook]

This was an Outlook 2003 system you had said? What was it doing with the
Outlook 2007 PIA's installed? That definitely would never work.
 
T

TroySupport

No idea what they were doing on the machine, but it was consistent. The
assemblies were present on all workstations. I am guessing they were
installed with another piece of software which has subsequently been removed.
They don't get installed with the Office 2007 reader do they?
 
K

Ken Slovak - [MVP - Outlook]

The Office 2007 PIA's aren't installed on an Office 2003 system if the
compatibility pack or whatever it's called is installed. I just checked it.
 
T

TroySupport

Great.

Many thanks again Ken.

Ken Slovak - said:
The Office 2007 PIA's aren't installed on an Office 2003 system if the
compatibility pack or whatever it's called is installed. I just checked it.
 

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