A Microsoft Outlook email forum. Outlook Banter

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » Outlook Banter forum » Microsoft Outlook Email Newsgroups » Add-ins for Outlook
Site Map Home Register Authors List Search Today's Posts Mark Forums Read Web Partners

C# and New Inspector event



 
 
Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #4  
Old June 8th 07, 07:02 PM posted to microsoft.public.outlook.program_addins
Dmitry Streblechenko
external usenet poster
 
Posts: 2,116
Default C# and New Inspector event

I have no idea how to do that in C#, sorry.

Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool

"bstrum" wrote in message
...
Any code examples? I was using the SafeCOMWrapper from

http://www.codeproject.com/csharp/Sa...97#xx1214201xx

but it doesn't include Inspectors. I added the following but I am getting
invalid cast exception:

[ComEvents(typeof(InspectorsEventSink), InspectorsEventSink.InterfaceID)]
public interface IInspectorsEvents
{
event NewInspectorEventHandler NewInspector;
}

[
ComImport,
Guid(InspectorsEventSink.InterfaceID),
InterfaceType(ComInterfaceType.InterfaceIsIDispatc h),
TypeLibType(TypeLibTypeFlags.FDispatchable)
]
public interface UCOMIInspectorsEvents
{
[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType =
MethodCodeType.Runtime), DispId(0xf001)]
void NewInspector(object NewInspector);
}

[ClassInterface(ClassInterfaceType.None)]
public sealed class InspectorsEventSink : ComEventSink,
UCOMIInspectorsEvents
{
internal const string InterfaceID =
"00063079-0000-0000-C000-000000000046";

static readonly object NewInspectorEvent = new object();

public void NewInspector(object NewInspector)
{
RaiseEvent(NewInspectorEvent, NewInspector);
}
}

public delegate void NewInspectorEventHandler(object NewInspector);

"Dmitry Streblechenko" wrote:

Your object must suppport the IDispatch and IInspectorEvents interfaces .

Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool

"bstrum" wrote in message
...
Does anyone have code to capture the new inspector event from c# using
late
binding? I need to be able to capture this event in an Office version
neutral way.

I put some code together but it fails on the advise method with an
invalid
cast exception.

Guid guid = new Guid("{000????-0000-0000-C000-000000000046}");
UCOMIConnectionPointContainer oCPP =
(UCOMIConnectionPointContainer)app;
oCPP.FindConnectionPoint(ref guid, out m_oConnectionPoint);
m_oConnectionPoint.Advise(this, out m_Cookie);

Thanks,

Benjamin Strum
ThinkTron Corp.






 




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Htmleditor from Inspector of Newinspector Event Kavitha Saivam Outlook - Using Forms 2 May 31st 07 03:30 PM
c++ and New Inspector event JahMic Add-ins for Outlook 2 March 21st 07 03:25 PM
selectionchange event for inspector? jiun Outlook and VBA 1 January 2nd 07 07:35 AM
Inspector Close Event is fired when spell checking is canceled. Arcady Outlook and VBA 6 December 28th 06 03:38 PM
HOWTO: Get the CommandBarComboBox event on the inspector tonyl Add-ins for Outlook 3 November 7th 06 02:18 PM


All times are GMT +1. The time now is 09:01 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.Search Engine Friendly URLs by vBSEO 2.4.0
Copyright ©2004-2025 Outlook Banter.
The comments are property of their posters.