Link to home
Start Free TrialLog in
Avatar of Tom Knowlton
Tom KnowltonFlag for United States of America

asked on

Is there a C# Exchange Server 2000 SDK?

Is there a C# Exchange Server 2000 SDK?

Please not the Exchange Server SDK with VB6 examples!  Already downloaded that one.
Avatar of Tom Knowlton
Tom Knowlton
Flag of United States of America image

ASKER

Or I guess it would not be just for C#....but for .NET.

I am using .NET 2002 and C#......and I want to create an Event Sink for Exchange Server 2000.

I have already followed ALL of the steps in the following tutorial:

http://www.codeproject.com/csharp/CsManagedEventSinksHooks.asp

I have had success all the way through up until it comes time to bind the component to an Exchange folder:

~~~~~~~~~~~~~~~~~
Excerpt from the tutorial:
~~~~~~~~~~~~~~~~~


We are done on our development part. Now, you can bind the component to any folder of exchange store, there are multiple ways to do this, I prefer the following,

RegEvent.vbs - I’ve attached the VBS file along with the download zip, this script creates the event registration for the specified folder. The following command binds the event sink to my inbox folder,

<tutorial gives sample command line at this point>

I’ve included the vbs file along with the zip file, you can also get more information about this at [ www.microsoft.com/exchange ]

Exchange Explorer – this is a tool you get with Exchange SDK [check www.microsoft.com/exchange ]

Alternatively, you can build your own event registration [that’s a separate article by itself :-) ]

At last, we are done... We have created our own Managed Exchange Store Event Sink. You can also implement the Synchronous Events and the System Events as same as we have implemented the Asynchronous events.

=============================================================




I cannot get the component to bind to the folder.  I get this error message:


Microsoft (R) Windows Script Host Version 5.6
Copyright (C) Microsoft Corporation 1996-2001. All rights reserved.

New Event Binding created:
Event: onsave;ondelete
Sink:  MyEventSink.ExchEventSink
FullBindingUrl: file://./backofficestorage/buyersfund.com/mbx/tom/FaxFailure/reg
Event.eml

Error Updating Props : -2147221163 Interface not registered

Press any key to continue . . .




I don't know why I am getting this error....or how to fix it.
ASKER CERTIFIED SOLUTION
Avatar of vascov
vascov
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
I GAC'ed my assemblies but doing so has not helped with the error message.

I still get:

Microsoft (R) Windows Script Host Version 5.6
Copyright (C) Microsoft Corporation 1996-2001. All rights reserved.

New Event Binding created:
Event: onsave;ondelete
Sink:  MyEventSink.ExchEventSink
FullBindingUrl: file://./backofficestorage/buyersfund.com/mbx/tom/FaxFailure/reg
Event.eml

Error Updating Props : -2147221163 Interface not registered

Press any key to continue . . .

I have created a web page which explains what I have done so far to troubleshoot this.

http://www.knowltonfamily.com/es_troubleshoot.htm
Turns out RegEvent.vbs is not needed.

Exchange Explorer  (found with Exchange 2003 SDK Tools) does the exact same thing.

Go here for details:

https://www.experts-exchange.com/questions/20962654/Please-help-troubleshoot-Exchange-Event-Sink-registration-problem.html
The tutorial at this link:

http://www.codeproject.com/csharp/CsManagedEventSinksHooks.asp


is very very good......................but it does have some flaws.

1)  You do NOT need to run RegEvent.vbs AT ALL......ignore this suggestion in the tutorial.  Instead, download and install the SDK Tools and run Exchange Explorer instead to register the Event and hook it into the EventSink code.

2)  I recommend using regsvcs /appname:YourAppName <full path to your DLL including extension>      from the command line, instead of using the Component Services GUI to register the COM DLL.  I have to do some further testing to see if the GUI works...but I know for sure the command line route using REGSVCS works well.

3)  After you have registered the COM DLL (your event sink) in Component Services......then go and register the Exchange Store Event using Exchange Explorer.   THEN go back to Component Services....right-click on your App Name and click on START.   This is what actually starts the EventSink (your C# DLL) talking to the Exchange Store.  Until you do this nothing will happen.   This was left out of the tutorial.  A small thing, but an important thing to mention.
UPDATE:

Well, guess what?

I finally had a major breakthrough on this @!#$^% problem that has been driving me crazy for the last few weeks!!!!!!!


It is a very small change.

Apparently the method   MoveFirst(   ) does not work so well with Exchange.

This was the cause of my COMException:   "Interface not registered" error message this entire time.


The solution is to use    Move(1,0)     instead of MoveFirst(  ).


That's it.   Simple.

This answer came courtesy of Tom Rizzo, an author who was kind enough to correspond with me and help me figure-out finally what the problem was.:

Looking for a good book on programming Exchange, Outlook, ADSI and
SharePoint?  Check out http://www.microsoft.com/MSPress/books/5517.asp

My I also reommend:

.NET and COM: The Complete Interoperability Guide  ISBN:067232170X
http://www.amazon.ca/exec/obidos/ASIN/067232170X/componentsnot-20/701-9386310-4703553
More on the MoveFirst problem I described:

http://support.microsoft.com/default.aspx?scid=kb;en-us;273791


If you are getting into Event Sinks....I recommend the following tutorial:

http://www.codeproject.com/csharp/CsManagedEventSinksHooks.asp

Make sure and read the article questions and follow-ups at the bottom!

There are a few caveats.  E-mail me at my Profile e-mail address and we can talk about them.  :)