Answered by:
Load content in C# SwapChainBackgroundPanel from C++ runtime component

Question
-
Hello,
I have a UI written in C# XAML and I want to load a core (game) into the XAML page. Game is written in C++ runtime component. This must be done by using SwapChainBackgroundPanel.
Have anyone done anything like this before?
Thursday, September 26, 2013 6:26 AM
Answers
-
Hi Blaz,
Basically if you include two store app projects in one solution, you should have one main project, but these two projects are not relate with each other, this is not what you want. While setting reference from one project to another, it is not allowed in VS and a error must occur.
Read the document I suggest to you, you could make your C++ project as runtime component and used in C#.
There are also some similar topics you can get hint: http://social.msdn.microsoft.com/Forums/windowsapps/en-US/cfb03afa-cc5c-40f8-a2cf-f345ec69befb/adding-two-projects-in-one-windows-store-app-solution
Best Regards,
--James
<THE CONTENT IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, WHETHER EXPRESS OR IMPLIED>
Thanks
MSDN Community Support
Please remember to "Mark as Answer" the responses that resolved your issue. It is a common way to recognize those who have helped you, and makes it easier for other visitors to find the resolution later.- Edited by Jamles HezModerator Friday, September 27, 2013 1:29 AM
- Proposed as answer by Jamles HezModerator Monday, September 30, 2013 1:58 AM
- Marked as answer by Jamles HezModerator Monday, October 7, 2013 1:06 AM
Friday, September 27, 2013 1:28 AMModerator
All replies
-
Hi Blaz,
I think this one will help with your question: Windows Runtime Components in a .NET World.
Consuming the component from C# should seem familiar because it’s no different than referencing a class library. Note that there’s no reason to build a Windows Runtime Component if your only target is other managed code. You simply reference the WinRT project and then consume the classes as you would from an ordinary C# class library.
Best Regards,
--James
<THE CONTENT IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, WHETHER EXPRESS OR IMPLIED>
Thanks
MSDN Community Support
Please remember to "Mark as Answer" the responses that resolved your issue. It is a common way to recognize those who have helped you, and makes it easier for other visitors to find the resolution later.Thursday, September 26, 2013 8:40 AMModerator -
Hi Blaz,
I think this one will help with your question: Windows Runtime Components in a .NET World.
Consuming the component from C# should seem familiar because it’s no different than referencing a class library. Note that there’s no reason to build a Windows Runtime Component if your only target is other managed code. You simply reference the WinRT project and then consume the classes as you would from an ordinary C# class library.
Best Regards,
--James
<THE CONTENT IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, WHETHER EXPRESS OR IMPLIED>
Thanks
MSDN Community Support
Please remember to "Mark as Answer" the responses that resolved your issue. It is a common way to recognize those who have helped you, and makes it easier for other visitors to find the resolution later.Hello James,
thank you for your answer. The problem was that I had 2 projects.
- C# XAML project with UI
- C++ XAML project with core-game written in cocos2dx
The problem was when I made a reference from C# XAML to C++ XAML project, there were errors, because the two projects were all Windows store projects. (MainPage.xaml.cs, App.xaml.cs) -> same names in all projects.
This is why I decided to go for a C++ component, but now I am not able to run the core(game) from C# XAML.
Thursday, September 26, 2013 9:19 AM -
Anybody had simillar problem?Thursday, September 26, 2013 12:48 PM
-
Hi Blaz,
Basically if you include two store app projects in one solution, you should have one main project, but these two projects are not relate with each other, this is not what you want. While setting reference from one project to another, it is not allowed in VS and a error must occur.
Read the document I suggest to you, you could make your C++ project as runtime component and used in C#.
There are also some similar topics you can get hint: http://social.msdn.microsoft.com/Forums/windowsapps/en-US/cfb03afa-cc5c-40f8-a2cf-f345ec69befb/adding-two-projects-in-one-windows-store-app-solution
Best Regards,
--James
<THE CONTENT IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, WHETHER EXPRESS OR IMPLIED>
Thanks
MSDN Community Support
Please remember to "Mark as Answer" the responses that resolved your issue. It is a common way to recognize those who have helped you, and makes it easier for other visitors to find the resolution later.- Edited by Jamles HezModerator Friday, September 27, 2013 1:29 AM
- Proposed as answer by Jamles HezModerator Monday, September 30, 2013 1:58 AM
- Marked as answer by Jamles HezModerator Monday, October 7, 2013 1:06 AM
Friday, September 27, 2013 1:28 AMModerator