locked
How do I add a resource (.rc) file to my WinRT project

    Question

  • I need to have a custom cursor.  I found this link which purports to show how to do this:

    http://blogs.msdn.com/b/devfish/archive/2012/08/02/customcursors-in-windows-8-csharp-metro-applications.aspx

    However it involves loading the cursor form a resource (.rc) file (which, I am told, is the only way to create a custom cursor).  However when I try to follow the example, I cannot find any way to add a resource file to my project.  The 'Add New Item' option does not seem to include resource files.  Indeed, I have found articles that seem to indicate that .rc files are no longer used for WinRT apps.

    So my question is, how do I add an .rc file to my project so I can create a custom cursor.  If there is truly no way to do this anymore, then is there no way to create custom cursors?

    Thanks.

     
    Friday, January 11, 2013 4:34 PM

Answers

  • I recall resource editor isn't part of the Express edition before. Maybe it carried over to metro app development. You can try use a third party resource editor.


    Visual C++ MVP

    • Proposed as answer by Jesse Jiang Monday, January 14, 2013 6:53 AM
    • Marked as answer by Jesse Jiang Thursday, January 17, 2013 2:19 AM
    Saturday, January 12, 2013 4:41 AM

All replies

  • Instead of choosing "New Item" in the project->add menu, choose "Resource".


    Visual C++ MVP

    Friday, January 11, 2013 7:24 PM
  • Thanks for the reply.  I would have tried that if it weren't for the fact that the 'Resource...' item on that menu is greyed out.  I was assuming that was the case because I don't have a resource file, and I cannot figure out how to add one.  How do I go about enabling it?

    Thanks.

    Friday, January 11, 2013 7:55 PM
  • Strange, I choose the blank app (XAML) project template. Which one did you choose?

    Also I have resource dictionary and resource files in the new item templates. They are under the Visual C++->Windows Store node.



    Visual C++ MVP


    Friday, January 11, 2013 8:27 PM
  • I just created a new blank project.  I chose 'Visual C++/Windows Store' and 'Blank App (XAML)'.  After the project is created I right click on the App name in the Solutions Explorer and then click on 'Add'.  The 'Resource...' option is greyed.  Any idea what might be wrong?

    Thanks.

    Friday, January 11, 2013 9:09 PM
  • No idea, are you working in Express edition? I am using the professional edition.


    Visual C++ MVP

    Friday, January 11, 2013 11:21 PM
  • I am using the Express edition, but that really shouldn't matter should it?
    Saturday, January 12, 2013 3:39 AM
  • I recall resource editor isn't part of the Express edition before. Maybe it carried over to metro app development. You can try use a third party resource editor.


    Visual C++ MVP

    • Proposed as answer by Jesse Jiang Monday, January 14, 2013 6:53 AM
    • Marked as answer by Jesse Jiang Thursday, January 17, 2013 2:19 AM
    Saturday, January 12, 2013 4:41 AM
  • Not giving us a way to add cursors to the project in the Express version is bogus.  If Microsoft REALLY wants people to come and develop apps they need to provide ALL of the needed tools for free.  After all they are competing with iOS and Android, both of which provide everything you need.

    I do have the full version of Visual Studio 2010.  I will try and create a resource file with that and see if I can add it to the project manually.

    Thanks for the help.

    Monday, January 14, 2013 5:32 AM