Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

winelib + MFC

2 views
Skip to first unread message

carl wong

unread,
Mar 12, 2001, 7:56:07 PM3/12/01
to

I am trying to port an MFC app to Linux using winelib. Can someone please
give me a pointer or two??? I have looked at section 4 of the online
documentation and not much were mention there.

Thanks for help in advane.

-Carl


Francois Gouget

unread,
Mar 13, 2001, 1:26:25 PM3/13/01
to

Hi Carl,

carl wong wrote:
>
> I am trying to port an MFC app to Linux using winelib. Can someone please
> give me a pointer or two??? I have looked at section 4 of the online
> documentation and not much were mention there.

Sorry, about section 4 of the Winelib User Guide. It's true that it's
not very complete yet. Here's basically what you need to do:

* First you need to run winemaker on the MFC sources. Preferably you
should run it in '--interactive' mode to specify the right options for
the MFC and the ATL part (especially to get the include paths right).

* Then comes the long job of making the thing compile. The MFC don't
yet compile 'out of the box'. Some issues are compiler related, and some
make use of things that Wine does not support yet and thus have to be
ifdef-ed out.

* During that phase you will probably create a set of defines that have
to be there in order to get the MFC headers to compile. What I did is to
put them in afx.h, that way you don't need to copy them into each
application's makefile.

* Once it compiles, comes the link and there again you'll probably have
to ifdef out some more. But overall not that much has to be disabled.
Although here I have a bit over 4000 lines of diffs (but that's also to
get rid of C++ errors and annoying warnings).

* Then you can work on the application itself. At this point, make sure
winemaker generates a wrapper. It will do so automatically if it detects
the application as an MFC application or if you specify --mfc. The
wrapper is necessary to take care of initialization order issues.

* One more tip: you can start with gcc 2.95, but to get an MFC
application that works and can use COM components, you'll need to use a
more recent gcc, one from CVS for instance. Then specify:
-fms-extensions (helps get more stuff compiled)
-fshort-wchar -DWINE_UNICODE_NATIVE (helps with Unicode support)
-DICOM_USE_COM_INTERFACE_ATTRIBUTE (to get the COM stuff working)


--
Francois Gouget
fgo...@codeweavers.com

carl wong

unread,
Mar 13, 2001, 6:48:10 PM3/13/01
to
Sounds like you have already gone through this exercise. Can you post the
afx.h and the 4000 lines of diffs (things that you have to disable in MFC)
to the rest of the community??? This will definitely saves the rest of us a
lot of times.

-Carl

"Francois Gouget" <fgo...@codeweavers.com> wrote in message
news:3AAE6651...@codeweavers.com...

Francois Gouget

unread,
Mar 13, 2001, 7:11:21 PM3/13/01
to
carl wong wrote:
>
> Sounds like you have already gone through this exercise. Can you post the
> afx.h and the 4000 lines of diffs (things that you have to disable in MFC)
> to the rest of the community???

At this time no, for obvious copyright/licensing reasons.

> This will definitely saves the rest of us a lot of times.

Yes, it would. Plus it would allow a much better teaming of
resources. But the copyright/licensing issues meed to be resolved first.

--
François Gouget
fgo...@codeweavers.com

0 new messages