tag:blogger.com,1999:blog-8436642170609457318.post7566756150312914980..comments2020-02-29T22:28:54.148+01:00Comments on Bart's Software Cookbook: Making MFC controls available for WinForms through MFC subclassingBart Jollinghttp://www.blogger.com/profile/01531240801317106633noreply@blogger.comBlogger10125tag:blogger.com,1999:blog-8436642170609457318.post-8177400512649952432012-09-27T01:14:06.356+02:002012-09-27T01:14:06.356+02:00Hello
I'm trying to put on window form in C# o...Hello<br />I'm trying to put on window form in C# object type CEdit (MFC)<br />,<br />once using a CEdit object instead C3DMeterCtrl,<br />once by creating additional CMyEdit class in which i use object <br />of type CEdit and then puts CMyEdit instead C3DMeterCtrl<br />.<br />The CMyEdit control is able to run with in MFC window, <br />I created it in a separate project<br />.<br /><br />Generally C# project is able to compile it self, <br />but it did not displays in C# <br />form<br /> any CEdit control.<br /><br />In addition, the project starts until the moment of method CEdit -> Create( ...) <br />is used.<br /><br /><br /><br />I'll be grateful for suggestions how to solve this problem. <br /><br />ps I have used VS 2010.MBhttps://www.blogger.com/profile/14348598394298879955noreply@blogger.comtag:blogger.com,1999:blog-8436642170609457318.post-74044455330614520842012-09-25T15:51:21.885+02:002012-09-25T15:51:21.885+02:00Hi Bart- Thanks very much for your reply. I reprod...Hi Bart- Thanks very much for your reply. I reproduced your 3DMeter control porting project in VS 2010 with some minor modifications on the code, and have made it work. However, that is not what I need. What I want to have is to make an existing MFC window, e.g. a dialog to be able to appear in a .NET form the same way it does in the native MFC environment. I want to use C++/CLI to bridge the cap between .NET and MFC. With your method, I haven't been able to make it work with the MFC dialog without adding any extra drawing functions such as OnPaint and OnSize to draw the window as in the 3DMeter control. If you could provide any suggestions on my requirement, it will be very helpful and appreciated. -JasonAnonymoushttps://www.blogger.com/profile/00090752077980525545noreply@blogger.comtag:blogger.com,1999:blog-8436642170609457318.post-28918641395636000032012-09-24T00:23:50.479+02:002012-09-24T00:23:50.479+02:00Hi Jason, if you refer to the article on CodeProje...Hi Jason, if you refer to the article on CodeProject that I took as a basis and then apply the modifications as described in my post above, you will have a working example. If that is what you are looking for?Bart Jollinghttps://www.blogger.com/profile/01531240801317106633noreply@blogger.comtag:blogger.com,1999:blog-8436642170609457318.post-89315147569571701452012-09-20T16:49:25.012+02:002012-09-20T16:49:25.012+02:00It seems liklely that Sabeesh has ignored this thr...It seems liklely that Sabeesh has ignored this thread. I have a similar need as developer906 did. Bart- do you happen to have anything new on wrapping a MFC dialog application with C++/CLI to share with us? Thanks.<br /><br />JasonAnonymoushttps://www.blogger.com/profile/00090752077980525545noreply@blogger.comtag:blogger.com,1999:blog-8436642170609457318.post-89562466311503458462012-01-04T13:51:30.503+01:002012-01-04T13:51:30.503+01:00Hi Sabeesh
Can you please share source code of yo...Hi Sabeesh<br /><br />Can you please share source code of your sample. I want to export an MFC Dialog based application and facing an issue. When I load my Managed control (wrapping MFC Dialog) on C# winform based application the control shows nothing.<br /><br />Thanksdeveloper906https://www.blogger.com/profile/18033451872366297457noreply@blogger.comtag:blogger.com,1999:blog-8436642170609457318.post-45560001912630401062010-06-16T13:30:53.819+02:002010-06-16T13:30:53.819+02:00Works like a charm!!! Thank you!!Works like a charm!!! Thank you!!Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-8436642170609457318.post-2616046957936201762009-04-09T10:31:00.000+02:002009-04-09T10:31:00.000+02:00Hi Sabeesh,What immediately caught my eye is that ...Hi Sabeesh,<BR/>What immediately caught my eye is that your static MFC library "Controls" doesn't contain a working control. For example IDD_DUMMYVIEW doesn't have a corresponding resource (.rc file). Try making an MFC application first that can succesfully use your "Controls" libray and only if that works, try wrapping it in C++/CLI.<BR/><BR/>Success<BR/>BartBart Jollinghttps://www.blogger.com/profile/01531240801317106633noreply@blogger.comtag:blogger.com,1999:blog-8436642170609457318.post-11429670932580601532009-04-08T12:05:00.000+02:002009-04-08T12:05:00.000+02:00Hello,Thank you for your reply.I upload the progra...Hello,<BR/><BR/>Thank you for your reply.<BR/><BR/>I upload the program into http://rapidshare.com/files/218819433/MainForm.zip.html Please unzip the file and open the program using MainForm file and set the project "LoadControl" as "Set As Startup Project". <BR/>Please help me to solve this problem.<BR/><BR/>Thank you for your valuable time.<BR/>Looking forward for your response.<BR/><BR/>Sincerely,<BR/>Sabeesh C.S.Sabeeshhttps://www.blogger.com/profile/13072928665759519438noreply@blogger.comtag:blogger.com,1999:blog-8436642170609457318.post-9166004593218603662009-04-08T08:53:00.000+02:002009-04-08T08:53:00.000+02:00Hi Shabeesh,Can you please zip your code, put it s...Hi Shabeesh,<BR/>Can you please zip your code, put it somewhere on an internet sharing service (such as rapidshare or skydrive) and post the link here. <BR/>Regards<BR/>BartBart Jollinghttps://www.blogger.com/profile/01531240801317106633noreply@blogger.comtag:blogger.com,1999:blog-8436642170609457318.post-22976682368070005522009-04-08T07:02:00.000+02:002009-04-08T07:02:00.000+02:00Hello,Thank you for your information. I try to cre...Hello,<BR/>Thank you for your information. I try to create a control in MFC, just add a dialog box and add one text box to that dialog box and build it as a .dll file and create another file and do the steps like your blog. And I create another CLR project and give reference to the second program and can successfully build the application. But when I set the width and height of the control, the new control, in CLR project, then, the program crash at the running stage. How can i solve this problem, Please help meSabeeshhttps://www.blogger.com/profile/13072928665759519438noreply@blogger.com