Is there a way to import a C# windows form and user control into C++.NET? I'm using VS2008 and have VS2010 installed as well.
A:
There's a plugin for reflector that will render the code as C++ (http://www.sandpapersoftware.com/Main/Reflector.html) - open your compiled-from-c# dll with that...
Rob Fonseca-Ensor
2010-08-26 20:55:57
+3
A:
If you have a .NET assembly or control in an assembly it doesn't matter wheter you code and use it from managed C++, C# or VB.NET or any other .NET language, that's one of the reasons why .NET was invented: be language independent.
To use it: simply reference the .NET assembly in the new project.
jdehaan
2010-08-26 20:57:14
Alright, did that. And I can run the form from my managed C++ main. The question is, would I be able to wire the form in such a way that the events the form generate go directly into my C++ instead of the C# code?
2010-08-26 21:08:21
If these events are public just do it, it'll work, only the language differs, the underlying .NET generated assembly possesses all the mechanisms you are used to. See doc here: http://msdn.microsoft.com/en-us/library/7kz5cx8k.aspx
jdehaan
2010-08-26 21:21:42
A:
Move your UserControl into a Class Library project and add this project as a reference.
BlueCode
2010-08-26 20:58:38