July 2004 - Posts

Paul Vick's DNS Problems

Paul Vick left a comment to my original post explaining that he's having DNS problems and they should be cleared up in the next few days.

Posted by PSteele | with no comments

Paul Vick's blog: MIA?

Anyone else notice that Paul Vick's blog is gone? It appears the domain name has been scooped up by someone else (it redirects to qp.org -- but whois still shows Paul as the owner). Hopefully he'll start up again at blogs.msdn.com.
Posted by PSteele | 4 comment(s)

My 15Seconds Article

I recently wrote an article for 15Seconds.com and it has been published today. Check out "COM Interop Exposed" and let me know your opinions. I plan on doing a follow-up article on exposing .NET events to COM clients (i.e. COM's Connection Point Protocol -- IConnectionPoint, IConnectionPointContainer, etc...).

Posted by PSteele | 1 comment(s)

Interfaces "Flattened" during COM Export

While researching a question someone asked, I discovered that TLBEXP will "flatten" out your .NET interface hierarchy.

Assume you have a simple .NET interface such as:

public interface IFoo
{
	void Method1_v1();
	void Method2_v1();
}

When exported to COM, the interface in OLEVIEW looks something like this (only relevant portions shown here):

interface IFoo : IDispatch {
	HRESULT Method1_v1();
	HRESULT Method2_v1();
};

Later, you want to add more functionality so you define a new interface that inherits from the previous one:

public interface IFoo2 : IFoo
{
	void Method1_v2();
}

When exported to COM, your two interfaces now appear as:

interface IFoo : IDispatch {
	HRESULT Method1_v1();
	HRESULT Method2_v1();
};

interface IFoo2 : IDispatch {
	HRESULT Method1_v2();
};

You've lost your interface hierarchy. This is a "by design" issue as documented in MSDN:

All exported interfaces extend directly from either IUnknown or IDispatch, regardless of their inheritance hierarchy in managed code.
Posted by PSteele | with no comments
More Posts