to call c# form in visual c++
I have to create a form in C-shar开发者_Go百科p(C#) and I want to call it on visual C++. How would I call my forms in visual C++.
Here are some solutions.
1) If your willing to turn on the CLR, then you can use Visual C++ .NET code to simply call up the form which is compiled within the C# assembly.
2) If you cant turn on the CLR, and your visual C++ program can use COM to initialize the C# form. Create a COM object within your C# application to host the form. Create a COM factory to implement the LocalServer32 model for DCOM. This is not a simple procedure, so use with caution
3) If your C# form can be converted into a C# usercontrol instead, then you can make your C# usercontrol into an ActiveX and use that instead. It helps if your C++ program can host ActiveX controls. If your using ATL or MFC, you shouldnt have much problem here.
精彩评论