I am wondering if someone can point me to good (up to date) doc on how
to go about porting a MFC app to wxWidgets. I've done a quick google and
found a few links but would like to know if other info is available
either on wxWiki or someone knows of a well written HowTo doc.
--
Kind Regards,
Rajinder Yadav | http://DevMentor.org | Do Good! ~ Share Freely
Or you want you app to be cross-platform?
Thank you.
> --
> To unsubscribe, send email to wx-dev+un...@googlegroups.com
> or visit http://groups.google.com/group/wx-dev
>
RY> I am wondering if someone can point me to good (up to date) doc on how
RY> to go about porting a MFC app to wxWidgets. I've done a quick google and
RY> found a few links but would like to know if other info is available
RY> either on wxWiki or someone knows of a well written HowTo doc.
To the best of my knowledge there is no such doc. IMHO it would be pretty
impossible to write, it's a bit like asking for a doc about how to write an
app in wxWidgets -- this is a too generic question and while you certainly
can find elements of answer in the existing posts, articles and books, you
will never find a definitive manual about how to do it.
Certainly you start with something existing in one case and not the other
but each program is still different and you need to decide how much of the
existing to keep and how much to change. IMO trying to keep as much of it
as possible is usually a bad idea because MFC programs often have a history
-- and the associated baggage -- of many years so you can significantly
clean them up in process of porting too and this is something that will
make your job simpler.
The only advice I can give is to avoid trying to translate MFC code to wx
"line by line" i.e. trying to keep exactly the same structure and
organization at all price. Of course, you don't need to change the existing
code if it maps well to wx way of doing things but don't try to shoehorn
MFC logic in wx program, this will result in more grief than anything else.
Good luck,
VZ
Hi Igor,
yes the app needs to be x-platform, I am researching what will be
required to switch over to using wxWidget, what pitfalls to avoid and
what if any thing that MFC does you will not find an equivalent in
wxWidget such as OLE support.
On Sat, Apr 30, 2011 at 10:26 PM, Rajinder Yadav <devg...@gmail.com> wrote:
> On 11-04-30 05:40 PM, Igor Korot wrote:
>>
>> Hi,
>> It is possible for MFC and wxWidgets to co-exist. Take a look at the mfc
>> sample.
>>
>> Or you want you app to be cross-platform?
>>
>> Thank you.
>>
>> On Sat, Apr 30, 2011 at 1:29 PM, Rajinder Yadav<devg...@gmail.com>
>> wrote:
>>>
>>> Hello all,
>>>
>>> I am wondering if someone can point me to good (up to date) doc on how to
>>> go
>>> about porting a MFC app to wxWidgets. I've done a quick google and found
>>> a
>>> few links but would like to know if other info is available either on
>>> wxWiki
>>> or someone knows of a well written HowTo doc.
>
> Hi Igor,
>
> yes the app needs to be x-platform, I am researching what will be required
> to switch over to using wxWidget, what pitfalls to avoid and what if any
> thing that MFC does you will not find an equivalent in wxWidget such as OLE
> support.
OLE is WIndows only. However there is an IPC (inter-process communication) that
you can use.
Everything that MFC does can be implemented natively under *nix and
Mac and that's
what wx do best.
Thank you.
>
> --
> Kind Regards,
> Rajinder Yadav | http://DevMentor.org | Do Good! ~ Share Freely
>
> http://ca.linkedin.com/in/rajinderyadav
>
Hello VZ,
I agree with what you're saying, but for 80% even 90% of all app ever
written in MFC, all will share a very common, core subset of the
framework, same would be true for wxWidget apps. These areas could very
well be documented.
i.e basic class hierarchy, persisting object, app/doc/view model,
message/event maps, drawing, threading, just to new a few common areas.
I'll try to avoid shoehorning MFC logic into wxWidgets, I am hoping
those areas will be obvious during any porting efforts if the company I
am at decides to use this framework. If that happens, I guess I could
document the process as a side-project.
Thanks Igor, I will keep the IPC model in mind if we encounter any OLE
code, I am sure those section will have to be re-written as well as any
active-x component code.
> OLE is WIndows only. However there is an IPC (inter-process
> communication) that you can use.
OLE is typically used to support drag and drop. A quick check of the
headers reveals that drag and drop is handled in include/wx/dnd.h, so look
at the classes there to get ideas on how to translate MFC/OLE to wx DND.
On Tue, May 3, 2011 at 5:01 PM, Kenneth Porter <sh...@sewingwitch.com> wrote:
> On Saturday, April 30, 2011 10:39 PM -0700 Igor Korot <ikor...@gmail.com>
> wrote:
>
>> OLE is WIndows only. However there is an IPC (inter-process
>> communication) that you can use.
>
> OLE is typically used to support drag and drop. A quick check of the headers
> reveals that drag and drop is handled in include/wx/dnd.h, so look at the
> classes there to get ideas on how to translate MFC/OLE to wx DND.
There is also very good article on CodeProject about MFC->wxWidgets classes by
Priyank Boila.
You should definitely take a look there.
Thank you.
> There is also very good article on CodeProject about MFC->wxWidgets
> classes by Priyank Boila.
> You should definitely take a look there.
I see these two articles:
<http://www.codeproject.com/KB/library/wxwidgets.aspx>
<http://www.codeproject.com/KB/cross-platform/Linux.aspx>
There's also this:
<http://wiki.wxwidgets.org/WxWidgets_For_MFC_Programmers>
Something I don't see addressed is converting resource files. I suspect
most MFC programmers design their dialogs with a visual designer in a fixed
format and then store them in a resource file.
My practice with wx is to design my GUI with wxFormBuilder, generate a .cpp
and .h file, and then inherit from the generated classes to customize the
behavior. I don't touch the generated files, so I can easily edit them in
the builder and regenerate them. I've been pretty happy with this work flow.
I know there are other GUI design tools that others prefer, so I won't say
that wxFormBuilder is the perfect solution for every job, but I've not
found any reason to complain about it.
But if I had to convert a big MFC app with lots of resource files, I don't
know what tools I'd use for that.
Thanks for the input and digging up the article, much appreciated. My
wxWidgets book just arrived a few days ago, so I'll need to read up on
wx to get a better feel for things.