DCSIMG
Windows 8,COM - Pavel's Blog
Sign in | Join | Help

Pavel's Blog

Pavel is a software guy that is interested in almost everything
software related... way too much for too little time

Browse by Tags

My Wish List for Windows “Blue”
17 May 13 05:48 PM | pavely | with no comments
Many rumors are flying around at this time about the upcoming release of Windows 8.1 (code named “Blue”, which represents a wave of product updates, including Windows Phone and others). I thought I‘d state my hopes for this release, not just in terms of user features, but also from a developer’s perspective. As a developer, I spend most of my time on my trusty laptop, not some tablet based device. Naturally, the desktop world is my friend. The Windows 8 Start screen is close to perfect for tablet...
Windows Runtime with C++/C#: Anatomy of a WinRT Class
30 December 12 09:47 AM | pavely | with no comments
The Windows Runtime (WinRT) is based on COM (I referred to it in the past as a “better COM”), which means every method and property must be part of an interface. Also, COM does not support static members (only instance members) and does not easily support parameterized constructors. Inheritance is again an issue in classic COM – the closest thing is COM aggregation, and that’s not really inheritance in the usual sense of the word. Using C++/CX or a .NET language allows creating WinRT types that support...
Windows Media Foundation in Windows 8
20 November 12 10:45 AM | pavely | with no comments
Windows Media Foundation was introduced in Windows Vista as a future replacement for DirectShow , enhanced in Windows 7, and naturally, further enhanced in Windows 8. I’ve blogged about WMF before . While looking at the MSDN docs on WMF, it seems the content has not yet been updated for Windows 8. Windows 7 enhancements are considered there as such. Looking at the API reference, however, shows some new interfaces that are only supported starting with Windows 8. One such interface is IMFMediaEngine...
Windows 8 Store apps with C++/CX: thoughts & tips
05 October 12 02:47 PM | pavely | with no comments
I’ve been working on Windows 8 apps lately using C++, not C#. I’ve been doing a lot of C# work in the past few years, and I must admit I love the elegance of C# and the productivity of .NET, not to mention the powerful toolset bound with Visual Studio. Still, ever since WinRT was introduced, the idea of using native code only had its appeal. Even if the app does not require special libraries, such as DirectX or C++ AMP , native code has less overhead and lower memory consumption compared to a .NET...
Using C++/CX in Desktop apps
29 September 12 04:20 PM | pavely | 4 comment(s)
In my first and second post on using WinRT in a desktop app, we’ve used the raw API and then WRL to create and access WinRT objects. It would be easier to access WinRT using the new C++/CX extensions. Can we do that from a desktop app? Let’s give it a try. We’ll start with a regular Win32 Console application project. The first thing we need to do is to enable the C++/CX extensions. Open project properties and navigate to the C/C++ / General node and set “ Consume Windows Runtime Extension ” to Yes...
Accessing WinRT from Desktop Apps (Part 2)
24 September 12 04:24 PM | pavely | 1 comment(s)
In the previous post we’ve seen how to instantiate WinRT objects using the raw (Ro, pun intended) API. In this post, we’ll see some shortcuts to make our lives a little easier. These shortcuts are part of the Windows Runtime template Library (WRL). This is a helper library, similar in spirit to the Active Template Library (ATL) used for classic COM work. First we need to include the main WRL header, <wrl.h> . Also, we’ll include another header with some extra helpers, that are not included...
Accessing WinRT From Desktop apps (Part 1)
13 September 12 12:17 PM | pavely | 1 comment(s)
The Windows Runtime (WinRT) is the underlying runtime for Windows 8 Store Apps (“Metro”), but some of it can be actually used outside the Metro environment, in regular desktop apps, such as pure Win32, MFC, etc. There are several ways to go about it; most of the time we’ll use the Windows Runtime Library (WRL) to help out with some of the low level details. Or, for a true high level abstraction, we can use the C++/CX extensions to the C++ language (making our code non-standard). But, just for kicks...
Windows 8 & Phone 8 UG August Meeting
29 August 12 11:22 PM | pavely | with no comments
Last evening we had a User Group meeting in Microsoft Offices in Ra’anana, with a lot of activity and fun. Thank you all for participating! In the first part, we discussed the Windows 8 Store from various angles, end user and developer. In the second part, we discussed Windows Phone 7.x and the upcoming 8, along with other sporadic topics - C++, WinRT, DirectX, COM, XNA, XAML… it was fun! And don’t forget the giveaways! Just as a gentle reminder, out next meeting is on September 13th , where we’ll...
Win32 and Metro–CreateFile(2)
03 May 12 01:05 PM | pavely | 1 comment(s)
When a new Windows version comes out, I’m always curious about the new Windows API (Win32) functions that are added to the release. With Windows 8, things get a little more complicated, as there are desktop apps and there are metro apps. Now, for every Windows API function the documentation states whether this API is valid for desktop apps only or for desktop apps and metro apps. One classic function is CreateFile . This is one of the oldest functions – exists since the very first Windows NT version...