WinRT.NET 4.5 and RCW

It is curious if someone had enough time with WinRT to understand if there are areas in WinRT and .NET 4.5 that erase the .NET programmer, some of the old elements found in VSTO and COM Interop Office programs related to RCW and differences in the counting of COM and .NET GC links beyond the use of the finalizer (make sure you get a link to all .NET RCW, etc.).

It doesn't matter if they are just curious if they distracted these considerations or even better, but the architecture is significantly different, and these problems are not even applicable.

Thank you in advance

Perhaps the best way to ask the question is, is this still essentially the same architecture of .NET objects in the managed / garbage collection memory model referencing COM (WinRT) objects in the unmanaged (for now) architecture of the isolated reference memory counting?

If there is no β€œmagic” in the metadata bindings or the isolated environment, then we just need to apply the same approach as with RCW.

+4
source share
3 answers

I created two full preview applications in C # / XAML. WinRT objects are treated like regular C # objects. There is no need for finalizers or other traditional .NET / COM interoperability tools. The predictions on .NET make the WinRT API pretty smooth.

There are several areas where COM leaks.

  • Exceptions thrown by WinRT objects do not have stack trace
  • Most exceptions thrown by WinRT objects have a common exception type and include an HRESULT error code.

I expect these issues to be resolved in future builds of Windows 8.

There are also some abbreviations when similar types are defined in both WinRT and .NET ( IObservableVector and INotifyCollectionChanged )

+1
source

[Adding in response to Robert Sweeney ]

According to the official introduction of the .NET Framework blog post :

.NET APIs are not displayed through WinRT, but continue to work as they always are, opened using the CLR.

The following is said:

.NET developers are not strangers to technology interoperability. You can use COM Interop and P / invoke to call the built-in APIs from .NET code.

0
source

COM communication is not really applicable in WinRT, since WinRT completely bypasses Win32 architecture (i.e. they exist side by side). Since COM is on top of Win32, this is a completely separate transaction in the WinRT context.

Edit: Sorry - I'm wrong here. It is completely incomprehensible WinRT! Please see svick Comment below.

-1
source

All Articles