ackabacka
June 27th, 2007, 11:52 AM
Hi,
I'm really new to .NET so my questions are really basic.
I have a big MFC application that uses MFC dll gui components and some MFC dll non gui components (that takes MFC objects as parameters).
I would like to /clr compile my main MFC exe and start developing .NET dll gui components that I call from my main MFC exe (together with calling older MFC gui and non gui dlls).
I have managed to make, just for test, a test a /clr MFC exe and a .NET dll gui component (a form). The MFC app added a reference to the .Net dll and showed the .net form in a MFC dialog (which was more than I needed, just showing the form would have been enough) and it could communicate with the form and even listen to events.
I guess making .NET dll gui components that are shown without being hosted in an MFC dialog is possible and easy (right?).
But, my main problem is that I would like the .NET dll to use function that I have in my non gui MFC dlls.
My first idea was to make a an MFC C++ /clr DLL, similar to the MFC /clr exe. Not sure if that's possible though.
But, the part that I most about is if it's possible to add a reference to this in my .NET gui dll.
If so, than I thought I could make wrapper functions in my /clr dll and convert the managed and MFC function parameters.
I have a feeling that this is not possible though. I have a feeling that it's not possible to call an MFC dll from anything else than a MFC dll or exe.
If it's not, is there any other possible solution to reach the functions that I have in my MFC dll from a pure .net dll.
Anyone?
I'm really new to .NET so my questions are really basic.
I have a big MFC application that uses MFC dll gui components and some MFC dll non gui components (that takes MFC objects as parameters).
I would like to /clr compile my main MFC exe and start developing .NET dll gui components that I call from my main MFC exe (together with calling older MFC gui and non gui dlls).
I have managed to make, just for test, a test a /clr MFC exe and a .NET dll gui component (a form). The MFC app added a reference to the .Net dll and showed the .net form in a MFC dialog (which was more than I needed, just showing the form would have been enough) and it could communicate with the form and even listen to events.
I guess making .NET dll gui components that are shown without being hosted in an MFC dialog is possible and easy (right?).
But, my main problem is that I would like the .NET dll to use function that I have in my non gui MFC dlls.
My first idea was to make a an MFC C++ /clr DLL, similar to the MFC /clr exe. Not sure if that's possible though.
But, the part that I most about is if it's possible to add a reference to this in my .NET gui dll.
If so, than I thought I could make wrapper functions in my /clr dll and convert the managed and MFC function parameters.
I have a feeling that this is not possible though. I have a feeling that it's not possible to call an MFC dll from anything else than a MFC dll or exe.
If it's not, is there any other possible solution to reach the functions that I have in my MFC dll from a pure .net dll.
Anyone?