MFC Integration/Migration

G

Guest

Hi!

I have an MFC application that is under development in VS2003 and frankly
MFC seems difficult to use and poorly documented -- I frequently find the
only way to get example code is on the Internet, not in the huge, mosly
useless "MSDN Library". For example, I was advised to use CStatic for
drawing some color frames / backgrounds, but CStatic isn't on the Toolbox and
for those related components such as Picture, limited frame colors and no
background color property is exposed -- drawing a colored background takes a
PhD in MFC (greyed out macros everywhere -- yuck!!).

How can I gracefully migrate the unmanaged C++ MFC GUI and business logic to
integrate with C++/CLI (and C#) and Windows forms. Unfortunately, I'm stuck
with production quality requirements that eliminate VS 2005 for this
development cycle. Should I wrap the old C++ code and use a C# application
or vise-versa? Should I re-write the MFC GUI, which consists mostly of
customized user drawn buttons, or should I wait for MFC with Windows Forms
classes -- any suggestions to alleviate my VS2003/.NET 1.1 restriction would
be appreciated.

Thanks for any advice!
 
T

Tom Serface

Hi Dave,

You are right that MFC takes some time to learn, but you can drop a static
from the toolbox. You just need to assign it an ID since the default ID
is -1 assuming you are just putting in a static label. That can be done
easily in the properties. There are also tons of books written on MFC that
help overcome some of the problems of the documentation.

That said, I think some of the new stuff coming in 2005 will help you with
the migration to managed. I'm looking forward to working that direction as
well.

Tom
 
A

alex

Dave,

There is a tool to migrate the GUI portion of an MFC app. It will
migrate any dialogs/views and common controls you have. It's called RC
Converter (www.dudelabs.com). You could use that to migrate the GUI
portion. Then you could wrap the C++ business logic in a COM or
managed code wrapper. If you don't like MFC I don't know that I would
wait for MFC support of WinForms (which is in 2005).

Alex
 
G

Gary Chang[MSFT]

Hi Dave,
I have an MFC application that is under development in VS2003
and frankly MFC seems difficult to use and poorly documented.

Besides the MSDN MFC documentation, I suggest you could also take a look on
the well-known MFC book <<Programming with Microsoft Visual C++
..NET,>>(Sixth Edition(MS Core Reference) / by George Shepherd), it will
provide you the basic and general knowledge about MFC programming in
VC.NET.

How can I gracefully migrate the unmanaged C++ MFC GUI and
business logic to integrate with C++/CLI (and C#) and Windows forms.
...

I think you can also post this question in our corresponding MSDN forum,
you may get some valuable opinions there:

Visual C++ Language
http://forums.microsoft.com/msdn/ShowForum.aspx?ForumID=96


Thanks!

Best regards,

Gary Chang
Microsoft Community Support
--------------------
Get Secure! ¡§C www.microsoft.com/security
Register to Access MSDN Managed Newsgroups!
http://support.microsoft.com/default.aspx?scid=/servicedesks/msdn/nospam.asp
&SD=msdn

This posting is provided "AS IS" with no warranties, and confers no rights.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top