Hi;

First off this is a .NET/C#/IDTExtensibility2 application.

The following code works fine on two computers:

public void OnConnection(object application, ext_ConnectMode
connectMode, object addInInst, ref Array custom)
{
applicationObject = application;
}

public void OnStartupComplete(ref Array custom)
{
ApplicationClass app = applicationObject as ApplicationClass;
app.ApplicationEvents3_Event_DocumentOpen += new
ApplicationEvents3_DocumentOpenEventHandler(Event_DocumentOpen);
}

But on a third computer, while app comes back as a System.__ComObject,
the attempt to get the document open event throws a "Object reference
not set to an instance of an object" exception.

This third computer has Office 2003 installed on it. However, the
other 2 computers have VisualStudio installed and this one does not -
if that makes any difference.

Any ideas?

thanks - dave

ApplicationClass vs Application by David

David
Fri Jul 09 23:28:38 CDT 2004


Hi;

First off this is a .NET/C#/IDTExtensibility2 application.

The following code works fine on two computers:

public void OnConnection(object application, ext_ConnectMode
connectMode, object addInInst, ref Array custom)
{
applicationObject = application;
}

public void OnStartupComplete(ref Array custom)
{
ApplicationClass app = applicationObject as ApplicationClass;
app.ApplicationEvents3_Event_DocumentOpen += new
ApplicationEvents3_DocumentOpenEventHandler(Event_DocumentOpen);
}

But on a third computer, while app comes back as a System.__ComObject,
the attempt to get the document open event throws a "Object reference
not set to an instance of an object" exception.

This third computer has Office 2003 installed on it. However, the
other 2 computers have VisualStudio installed and this one does not -
if that makes any difference.

Any ideas?

thanks - dave


Re: ApplicationClass vs Application by Mike

Mike
Thu Jul 15 14:54:17 CDT 2004

Have you installed the Extensibility.dll as this is required for talking to
the COM Addin interfaces, this is in the vs.net common folder public
assemblies and maybe for testing purposes able to be copied into the same
directory as the assembly you are running.

Rgds

Mike Walker
(Reply via NG)
"David Thielen" <david@windward.net> wrote in message
news:g2sue09gget9pqea2caeacj8b93h5e73l2@4ax.com...
>
> Hi;
>
> First off this is a .NET/C#/IDTExtensibility2 application.
>
> The following code works fine on two computers:
>
> public void OnConnection(object application, ext_ConnectMode
> connectMode, object addInInst, ref Array custom)
> {
> applicationObject = application;
> }
>
> public void OnStartupComplete(ref Array custom)
> {
> ApplicationClass app = applicationObject as ApplicationClass;
> app.ApplicationEvents3_Event_DocumentOpen += new
> ApplicationEvents3_DocumentOpenEventHandler(Event_DocumentOpen);
> }
>
> But on a third computer, while app comes back as a System.__ComObject,
> the attempt to get the document open event throws a "Object reference
> not set to an instance of an object" exception.
>
> This third computer has Office 2003 installed on it. However, the
> other 2 computers have VisualStudio installed and this one does not -
> if that makes any difference.
>
> Any ideas?
>
> thanks - dave
>