Hello,
Over the past few months I have been working with wine and winelib in my spare
time. Eventually I hope to port a Win32 app to linux using winelib. The next
major hurdle in the port is MFC. I see two paths and I am seeking advice and
help.
1. Compile MFC. Several years ago we (Lumin Software) tried to compile MFC.
The attempt failed and we found another way to do what we wanted. MS
documentation states that compiling MFC was deliberately made difficult.
Considering my experience with stuff they call "easy" I am not looking forward
to compiling MFC. We are currently using Visual Studio 5 for windows
development.
2. Create some code that loads and initializes the MFC library and allows
access to the MFC functions from within winelib. I know how to do this. I
successfully ran the EdrTest/EdrLib example from Petzold last weekend. In my
code, I had edrtest compiled under winelib and it ran the functions using the
windows compiled edrlib.dll. I think this solution may be easier, but it
requires over a thousand functions in MFC to be hooked up. However, it looks
like the process can be automated. There is a text file (MFC42.DEF) with the MFC
libraries that contains the ordinals and the mangled names. From this file it
is possible to automatically create the spec file, the pointers to functions,
and the initialization of the pointers. The automation would require a name
de-mangler. So far I have found no documentation on MS C++ name mangling.
In short, which of these paths has the most chance of success (most likely to
succeed with the least work) ? Does anyone know the MS name mangling scheme?
If the second path is most likely, the glue code I write can be put in the wine
tree for others to use. However, each user of wine/winelib would need to provide
their own MFC dll. The MFC dll is redistributable as long as I am
distributing it as part of an application that provides significant added
functionality. Hence, I can distribute the MFC dll with my application. (I read
this from the license, but I am not a lawyer nor do I play one on TV).
--
Wilbur Dale
Lumin Software BV
Zandheuvel 52 B
4901 HW Oosterhout (NB)
The Netherlands
phone: +31-(0)162-47.88.42
fax: +31-(0)162-43.31.52