Why set up this projects????

Apr 10, 2009 at 8:47 AM
I use vista sdk's icontract.idl, and convert it icontract.dll, but it doesn't work. I get the error that the ContactManagerClass doesn't support the IContactManager interface, is the icontract.idl doesn't be supported in csharp? 

Is that the reason to create this project?
Apr 10, 2009 at 3:33 PM
I started the project because the way the methods in the IDL are structured make it very difficult to consume the APIs from managed code without a wrapper layer.  I ended up basically doing a rewrite because there are bugs in the native implementation that I was unable to get fixed, and by doing it all in C# I was able to make a version that works on XP.

I haven't recently tried importing the IDL to a TLB/DLL.  Maybe you're creating the object on an MTA thread?  The native APIs require STA and all the objects have thread affinity.
Apr 11, 2009 at 10:33 AM
Thx! JoeCastro, The failure is definitely not setting the Thread's affinity. Now it's working well in csharp, Thx again!
Apr 11, 2009 at 8:36 PM
Glad that worked.
You might find this wiki page useful: http://contacts.codeplex.com/Wiki/View.aspx?title=Gotchas
It's random strange things I found where the native APIs may not behave as you would expect.
Apr 13, 2009 at 6:59 AM
yeah, but my requirement is so easy and your project is also so easy to use that I choose to use your project to implement my project. I'll pay more attention to your project. Thx