Pavel Podlipensky
Pavel Podlipensky

Reputation: 8269

Where does IDispatchEx exists?

Can't find the library which contains IDispatchEx interface. I want to implement this interface, but can't find it. Does anyone knows where it is?

Thanks, Paul.

Upvotes: 3

Views: 1040

Answers (2)

Darin Dimitrov
Darin Dimitrov

Reputation: 1038880

If you want to write a managed class that implements the IDispatchEx interface you will first need to define this interface because it does not exist in .NET. Here's a link to its definition. IMHO implementing this interface won't be a trivial task.

Upvotes: 4

Marc Gravell
Marc Gravell

Reputation: 1062895

What exactly do you want to do? Is this for use inside C#? Or from outside (COM)?

If you just want browser support, then perhaps host in WebBrowser and set the ObjectForScripting.

You can sort of add methods to a type in C# 3.0 with extension methods:

public static void Bar(this Foo foo, int someArg) {...}
....
Foo foo = ...
foo.Bar(123);

But this is still static-typed. C# 4.0 introduces dynamic for true dynamic objects inside the CLR/DLR, but you'd implement IDynamicObject. And it isn't trivial.

Upvotes: 0

Related Questions