Attempting to add new explorer event handler (outlook) causes exception

From: Graham (anonymous_at_discussions.microsoft.com)
Date: 03/13/04


Date: Fri, 12 Mar 2004 23:36:07 -0800

Hi,

A simple C# Addin,

When invoking

m_outlookapp.Explorers.NewExplorer += new Outlook.ExplorersEvents_NewExplorerEventHandler(newExplorer);

newExplorer is defined as

private void newExplorer(Outlook.Explorer explorer)
{
   // .. do something
}

I am getting the following exception:

  System.Exception {"No such interface supported" } System.Exception
       System.Object {System.InvalidCastException} System.Object

at System.Runtime.InteropServices.UCOMIConnectionPoint.Advise(Object pUnkSink, Int32& pdwCookie)
   at Outlook.ExplorersEvents_EventProvider.add_NewExplorer(ExplorersEvents_NewExplorerEventHandler )
   at Outlook.ExplorersClass.add_NewExplorer(ExplorersEvents_NewExplorerEventHandler )
   at findAddin.Connect.OnStartupComplete(Array& custom)

This is on windows 2000 professional, office 2003, vstudio dev env is 7.0.9466, .Net Framework is 1.0

I am using Outlook and Office 11.0 Object library references. I am not using the XP PIA (primary interop assemblies)

Any help would be most gratefully received,

- graham



Relevant Pages

  • SqlCeConnection
    ... I have two module level SqlCeConnection objects, ... error but the Exception object does not contain a message to display. ... private void CloseConnection() ... SqlCeCommand sqlCommand = null; ...
    (microsoft.public.sqlserver.ce)
  • Re: Throwing Exceptions
    ... I just ran it and got the same result, it does not throw the exception! ... > private void InitializeComponent() ... > private void lblDest_DragDrop(object sender, ... >>> Create DragDrop event handler for label. ...
    (microsoft.public.dotnet.languages.csharp)
  • BeginExecuteReader doesnt work on one machine in my environment
    ... This exception is caught in the method, ... private delegate void loadReaderHandler(SqlDataReader sdr); ... private SqlConnection conn; ... private void aSynchTestHandler ...
    (microsoft.public.dotnet.framework.adonet)
  • Null exception error, Winforms
    ... The error is "An unhandled exception of ... private void btnSubCdAssign_Click(object sender, System.EventArgs e) ... stsFlag = true; ...
    (microsoft.public.dotnet.framework.windowsforms)
  • NullException on Exit app when performing updates on the dataset
    ... The error is "An unhandled exception of ... private void btnSubCdAssign_Click(object sender, System.EventArgs e) ... stsFlag = true; ...
    (microsoft.public.dotnet.framework.adonet)

Loading