tags:

views:

74

answers:

1

i have make a c# form in csharp and i want to call it on visual c++.how would i call my forms in visual c++.please give me some sloution.

+2  A: 

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.

Andrew Keith