wliang1

Interfaces from the same coclass, why some need explicit QI, some don't?

Discussion created by wliang1 on Jun 19, 2011
Latest reply on Jun 21, 2011 by wliang1
Hi,

I try to create a new map document in C# with the following code and cast it to an interface, while casting to IDocument I can implicitly cast to: IDocument iDoc= new MxDocument(); however, I need explicitly cast for the following interface: IMxDocument IMxDoc = new MxDocument() as IMxDocument. Is there any particular reason that one interface can implicit cast but the other can't?

Also, from the attached OMD, how can I tell that IDocument is defined in Framework assembly rather than ArcMapUI assembly, is this a bug for this OMD?

Thanks for your input.

Wei

Attachments

Outcomes