Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9038505
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T09:30:16+00:00 2026-06-16T09:30:16+00:00

I am writing a Windows 8 Store app using Visual Studio 2012. The main

  • 0

I am writing a Windows 8 Store app using Visual Studio 2012. The main app is a XAML/C# app but it also uses a WinRT component written using C++/CX. For the WinRT component, I am using the VS project template called “DLL (Windows Store apps)” from the New Project dialog. Once I have this project, I change it to contain a single namespace with a single ref class. My C# project contains a reference to this C++ project.

However, when I try to run my app, the C# code throws an exception at the point it tries to instantiate/activate the C++ ref class. I have seen several working examples of this even on MSDN samples. I have verified that the WinRT component DLL and the winmd files are correctly copied into the final app package, and also that the app’s AppxManifest.xml is properly updated with the correct registration information for the WinRT class. However it still fails.

I don’t know what’s going wrong. How can I fix this error?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-16T09:30:17+00:00Added an answer on June 16, 2026 at 9:30 am

    Windows Runtime component binaries are required to have the following two exports:
    DllCanUnloadNow
    DllGetActivationFactory

    When you use the VS project template “DLL (Windows Store apps)”, your project doesn’t define the requisite macro that causes the compiler to put the above two exports in the binary. Under project settings you will notice that the macro set is _WINDLL. You will need to change this to _WINRT_DLL.

    Alternatively, the correct way to create a WinRT component using C++/CX is to use the VS project template called “Windows Runtime Component” under Visual C++ -> Windows Store. Using this will create a project which is already correctly setup with the right project settings etc. for creating proper WinRT binaries.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm writing a Windows 8 app in C# using visual studio 2012 Ultimate. When
I am writing a Windows 8 Store App using JavaScript, HTML5 and CSS. On
I am writing a Windows Store App toy application for Windows 8. It has
We are writing a Windows Store app. A lot of the data processing and
I'm writing a Windows Store app in C#, how would one go about changing
I am writing a Windows Store app which will enale the user to search
I'm writing a Windows Store App. It is a share target that allows the
We're writing Windows desktop apps using C++ and Win32. Our dialog boxes have an
I'm currently writing a Windows Explorer Shell Extension. Everything is ok so far but
I am writing a Windows 8 App that will primarily run in the background.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.