How to add an MFC CWnd to a non-MFC app 
Author Message
 How to add an MFC CWnd to a non-MFC app

We have rather large application which for historic reasons uses a
home-grown cross platform library, which is largely redundant since we
now support Windows only. The cross-platform part of the app supports
lowest common denominator type GUI objects- windows, menus, buttons,
nothing fancy. We would like the capability to insert an MFC CWnd into
our app so that we could have access to all of the GUI elements that
MFC supports. I have plenty of experience writing MFC apps, however, I
have never before done something like this. What are the pertinent
issues? Can I simply attach a CWnd to one of our windows and expect
everything to work? We would most likely want to use a CFormView and
place a bunch of controls on it.

TIA



Wed, 27 Jul 2005 00:45:45 GMT  
 How to add an MFC CWnd to a non-MFC app
Lux,

Several years ago, I was in a project where we did just this on a humongous
application - we wanted to add the OLE-support possible through MFC.

Our approach was to create a skeleton MFC-app, jacking in the old app main
window display code into InitInstance of the new one.

After the initial hassle, which was in no way unsurmountable and quite
localized in scope, the old-style dialogs etc worked well with newly added
MFC-objects. It was actually just a few days of work, including turning the
app into an automation server :-)

Johan Rosengren
Abstrakt Mekanik AB


Quote:
> We have rather large application which for historic reasons uses a
> home-grown cross platform library, which is largely redundant since we
> now support Windows only. The cross-platform part of the app supports
> lowest common denominator type GUI objects- windows, menus, buttons,
> nothing fancy. We would like the capability to insert an MFC CWnd into
> our app so that we could have access to all of the GUI elements that
> MFC supports. I have plenty of experience writing MFC apps, however, I
> have never before done something like this. What are the pertinent
> issues? Can I simply attach a CWnd to one of our windows and expect
> everything to work? We would most likely want to use a CFormView and
> place a bunch of controls on it.

> TIA



Wed, 27 Jul 2005 19:42:10 GMT  
 How to add an MFC CWnd to a non-MFC app
Hi Lux,

Also, you can learn from one KB article:

Q173974  HOWTO: Add MFC Support to an ATL Project

Hope it helps.

Best regards,
yhhuang
VS.NET, Visual C++
Microsoft

This posting is provided "AS IS" with no warranties, and confers no rights.
Got .Net?  http://www.gotdotnet.com
--------------------
!NNTP-Posting-Date: Fri, 07 Feb 2003 17:45:47 -0600

!Newsgroups: microsoft.public.vc.mfc
!Subject: How to add an MFC CWnd to a non-MFC app
!Date: Fri, 07 Feb 2003 15:45:45 -0800
!Organization: ECLiPSE

!X-Newsreader: Forte Agent 1.93/32.576 English (American)
!MIME-Version: 1.0
!Content-Type: text/plain; charset=us-ascii
!Content-Transfer-Encoding: 7bit
!Lines: 13
!X-Trace:
sv3-zG3uhSaLCA7Qqv03b6iinRCBe5cxwiWh3WAjGQOoF7sJEDFarwmL6jt+YQl+b48dkJxNiUUe
Kroxn+d!gWOtgv/Q2VOzTem6w/TxWKjwFNqk37ENKC/T+DNYsoy1BTCriPWt7GryiEESmksy5ryV
ig==

!X-DMCA-Notifications: http://www.giganews.com/info/dmca.html
!X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers
!X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your
complaint properly
!X-Postfilter: 1.1
!Path:
cpmsftngxa08!cppssbbsa01.microsoft.com!news-out.cwix.com!newsfeed.cwix.com!n
ews.maxwell.syr.edu!newsfeed-east.nntpserver.com!nntpserver.com!border1.nntp
aus1.giganews.com!nntp.giganews.com!nntp3.aus1.giganews.com!news.giganews.c
om.POSTED!not-for-mail
!Xref: cpmsftngxa08 microsoft.public.vc.mfc:361757
!X-Tomcat-NG: microsoft.public.vc.mfc
!
!We have rather large application which for historic reasons uses a
!home-grown cross platform library, which is largely redundant since we
!now support Windows only. The cross-platform part of the app supports
!lowest common denominator type GUI objects- windows, menus, buttons,
!nothing fancy. We would like the capability to insert an MFC CWnd into
!our app so that we could have access to all of the GUI elements that
!MFC supports. I have plenty of experience writing MFC apps, however, I
!have never before done something like this. What are the pertinent
!issues? Can I simply attach a CWnd to one of our windows and expect
!everything to work? We would most likely want to use a CFormView and
!place a bunch of controls on it.
!
!TIA
!



Sat, 30 Jul 2005 03:39:39 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. MSVC6: Help adding MFC to non-MFC App

2. Adding MFC support to my non-MFC application

3. Adding MFC to non-MFC Application

4. Adding MFC-code to a non MFC Application(WIN-application)

5. Using non-MFC DLL in MFC app

6. using MFC in non-MFC app

7. Calling MFC DLLs from a non-MFC app

8. Link errors with MFC app and non-MFC library

9. Using non-MFC DLL in MFC app

10. non-mfc app needs to domodal on mfc dialog example

11. MFC with non-MFC app

12. Customize own App Wizard for non Mfc apps

 

 
Powered by phpBB® Forum Software