Presentation is loading. Please wait.

Presentation is loading. Please wait.

 Misha Shneerson Senior SDE Microsoft Corporation  Andrew Whitechapel Senior PM Microsoft Corporation TL02.

Similar presentations


Presentation on theme: " Misha Shneerson Senior SDE Microsoft Corporation  Andrew Whitechapel Senior PM Microsoft Corporation TL02."— Presentation transcript:

1  Misha Shneerson Senior SDE Microsoft Corporation  Andrew Whitechapel Senior PM Microsoft Corporation TL02

2

3 User code Assembly (50 Kb) Office 2007 PIA Redist (6.3 Mb) Office 2007 PIA Redist (6.3 Mb) Microsoft.Office. Interop.Excel.dll (1.2 Mb) Office 14 PIA Redist (6.3+ Mb) Office 14 PIA Redist (6.3+ Mb) Microsoft.Office. Interop.Excel.dll (1.2+ Mb)

4

5

6 IntelliSense, AutoComplete Type Information Partial Type Information Client Assembly Local Types VS Code Editor Primary Interop Assembly C#/VB Compiler C#/VB Compiler

7  Misha Shneerson Senior SDE Visual Studio BizApps

8 To enable the same behavior from the command line, pass the reference using /link

9

10

11 [ComImport] [Guid(“E09335AA-9623-407b-AF63-5767CC6B7730”)] interface IFoo { void Method1(IBar bar); void Method2(); void Method3(); void Method4(); IBar Method5(); void Method6(); void Method7(); void Method8(); void Method9(); void Method10(); void Method11(); void DoWork(void); void Method13(); void Method14(); };

12 namespace FooLib { [ComImport] [Guid("E09335AA-9623-407b-AF63-5767CC6B7730")] [TypeIdentifier] internal interface IFoo { void _VtblGap1_11(); // Skip 11 v-table slots preceding DoWork void DoWork(); void _VtblGap2_2(); // Skip 2 v-table slots following DoWork }

13

14

15

16  Misha Shneerson Senior SDE Visual Studio BizApps

17

18 Assembly B IFoo Partial Local Type Assembly A IFoo Partial Local Type Foo : IFoo void M(IFoo foo) { foo.DoWork(); } At call time CLR verifies B’s IFoo.DoWork has matching signature as A’s IFoo.DoWork() and invokes Foo.DoWork()

19

20

21

22

23

24

25 Please fill out your evaluation for this session at: This session will be available as a recording at: www.microsoftpdc.com

26

27 © 2008 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

28

29

30

31

32 User code IFoo_SinkHelper - Event1 - Event2 (stub) o.Event1 += Event1Handler IFoo_SinkHelper - Event1 (stub) - Event2 o.Event2 += Event2Handler COM Host OM IFooEvents - Event1 - Event2 IFooEvents - Event1 - Event2 2. Forward Event1 call 1. Fire Event1 Host PIA IFooEvents - Event1 - Event2 IFoo_SinkHelper - Event1 - Event2 Parameters marshalled Parameters marshalled again and cause “ghost” RCWs

33 // user types this xlapp.SheetSelectionChange += userDelegate // compilers analyze IAs and emit this ComEventsHelper.Combine(xlapp, sourceInterfaceIid, methodDispID, userDelegate)

34

35 User code EventHelper sink - Event1 e1 += new Event1_EventHandler COM Host OM IFoo_Event - Event1 - Event2 IFoo_Event - Event1 - Event2 2. Forward Event1 call 1. Fire Event1 e2 += new Event2_EventHandler EventHelper sink - Event1 - Event2

36

37

38


Download ppt " Misha Shneerson Senior SDE Microsoft Corporation  Andrew Whitechapel Senior PM Microsoft Corporation TL02."

Similar presentations


Ads by Google