Entries:
Comments:
Posts:

Loading User Information from Channel 9

Something went wrong getting user information from Channel 9

Latest Achievement:

Loading User Information from MSDN

Something went wrong getting user information from MSDN

Visual Studio Achievements

Latest Achievement:

Loading Visual Studio Achievements

Something went wrong getting the Visual Studio Achievements

Michael B. McLaughlin

Michael B. McLaughlin mikebmcl

Niner since 2011

  • Maelstrom: An Overview
  • XInput PInvoking your XBox 360 Controller

    DirectSound is only meant for legacy code; modern games should use XAudio2 and/or Microsoft Media Foundation for audio. DirectInput is deprecated and should only be used for legacy joystick and gamepad support (any controller that you can use XInput with you should use XInput, and keyboard and mouse should be used with standard Win32 messages, .NET classes, or Windows Runtime functionality.

    Otherwise, great article and sample!

  • The Windows Runtime Library (WRL)

    @Chris

    My understanding of it is that WRL is a handy way to bring legacy COM libraries forward to be used in Metro style apps without needing to rewrite them completely. It's also a way for people whose companies forbid the use of exceptions (I personally don't know why people do this, but there are places that do it and I'm sure they have their reasons) to write new Metro style libraries and apps without violating their company's internal policies.

    As far as motivations behind COM and the Windows Runtime (and WRL, which is basically a very thin layer on top of WinRT itself), the core purpose is to be able to write some code in whatever language you personally prefer and then let others use it from whatever languages they prefer. I can write a WinRT component in C++, C#, or VB that someone can then use in a Metro style app written in C++, C#, VB, or JavaScript without needing to do anything special. In fact, unless they specifically looked into it, they wouldn't have any idea what language my component was written in. The WinMD metadata file makes it just work (without any interop code) and so now my library is easily available to many more developers than it was before.

    C++ developers should default to using C++/CX to write WinRT components and Metro style apps. The reason for that is that, as you pointed out, WRL (like COM) has a lot of repetition and boilerplate code. But there are those situations where some people will want/need to avoid C++/CX (whether for portability reasons or for exception avoidance or whatever) and in those cases there's WRL.