Invalid Pointer connecting to Outlook Application using automation

  • Thread starter Thread starter TroySupport
  • Start date Start date
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
 
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.
 
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?
 
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.
 
Hi Ken,

Yes this is a standalone application.

Okay, will dust off the deerstalker and pipe. Thanks.
 
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?
 
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.
 
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
 
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.
 
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?
 
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.
 
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.
 
Back
Top