Click here to Skip to main content
15,884,879 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
i'm working on a program developed with mfc and winform.i use mfc to make an application frame,winform for UI.I search google which said it could be ok using hosting winforms in the mfc dialog box.but there're also some concerns.
1.i dont want set the mfc main frame project as clr...
2.my mfc project is based on dialog box.
3.i want to refer to winform UI library directly.
thanks in advance for your answers.
Posted
Comments
Sergey Alexandrovich Kryukov 30-Jun-14 0:43am    
Makes little to no sense... .NET and native Windows are different platforms; it is easy to use native code in .NET, but not the other way around. You can turn .NET code into a COM component, but I would strongly discourage doing it at all...
—SA
koll Zhu 30-Jun-14 4:45am    
why not?i can host clr in unmanaged mfc app and then execute the managed code.its the only question how to call a method returning none-int value.
Sergey Alexandrovich Kryukov 30-Jun-14 11:33am    
Well, because you probably want to stay out of trouble, so the effort would not worth the poorly maintainable unreliable result you would get, most likely. Who told you you only can return int?
—SA
koll Zhu 30-Jun-14 12:16pm    
I choose to host a CLR to execute the managed code.i use the interface ICLRRuntimeHost.it has a method executeindefaultdomain,the output para is a pointer to DWORD.i try to return the usercontrol handle and convert it to Cwnd*,but falsed.i don't known how to return a form or UserControl
Sergey Alexandrovich Kryukov 30-Jun-14 13:08pm    
You certainly can host CLR. I only cannot imagine that doing all that can get you any practical benefits, especially if the goal is dealing with such outdated thingy as MFC. :-)
—SA

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900