WRLClassLibrary for Visual Studio 2013

by BillKrat 13. November 2013 20:31

If you are here then odds are that you are searching for WRLClassLibrary – as of this writing it is not available for Visual Studio 2013.  I had to install Visual Studio 2012 in order to create a project to work with (I then removed VS2012).

EDITED – I created a template project that will only require you to rename the WRLClassLibrary.cpp and WRLClassLibrary.idl files (to the project name) after you select “WRL Class Library” from the project list. 

Simply drop the following template .zip file into your Libraries | Documents | Visual Studio 2013 | Templates | ProjectTemplates folder and this project template will appear next time you add a C++ project. 

Note: this didn’t work for the Express version of Visual Studio, for it you’ll have to apply the manual approach discussed in the original content of this blog (below).

TEMPLATE: WRL Class Library.zip


The template already has the source code (and link) for the Walkthrough: Creating a Basic Windows Runtime Component Using WRL tutorial in the .CPP and .IDL files.   As noted above, all you’ll have to do is rename the WRLClassLibrary.cpp and WRLClassLibrary.idl to Contoso.cpp and Contoso.idl respectively.  



Source: WRLClassLibrary.zip (generated by Visual Studio 2012)

TUTORIAL: Walkthrough: Creating a Basic Windows Runtime Component Using WRL

Note: using Visual Studio Express 2013 for Windows

1. In my Windows Explorer I highlighted WRLClassLibrary and hit CTRL-C and then CTRL-V to paste the highlighted copy of WRLClassLibrary-Copy in figure below:

Note: to comply with the tutorial steps I renamed the copied folder to “Contoso”


2. I renamed all instances of WRLClassLibrary (namespaces) to “Contoso”.  Note: the namespace must match the project name.


3. I then renamed all instances of “WinRTClass” to “Calculator” (per tutorial)


4. I rename Project and then the .CPP and .IDL files to Contoso.cpp and Contoso.idl respectively


5.  If it exists then delete the Debug folder and all WRLClassLibrary.* files  (reference red icons in image above right pane) – below is what it looked like after cleanup (showing all files)


6. At this point the project will compile but the tutorial will fail – I found that there is a project setting that needs to be renamed from WRLClassLibrary to Contoso.  To do this right click on the Contoso (renamed from WRLClassLibrary) project and select “Unload Project”


7. Rename the RootNameSpace from WRLClassLibrary to Contoso (in PropertyGroup Label=”Globals” below)


8. Right click Contoso project and reload it.  Below I show the updates made per tutorial



The following are the results after running the tutorial



Blog videos and references to CodePlex projects are no longer valid