I made a wish, wrote a letter to Santa...

Subhobroto Sinha subhobrotosinha at rediffmail.com
Tue Dec 9 01:54:21 CST 2003


An HTML attachment was scrubbed...
URL: http://www.winehq.org/pipermail/wine-devel/attachments/20031209/e197cfe4/attachment.html
-------------- next part --------------
With XMas nearing, I thought it was time I made my yearly wish to Santa - that he would let his elves use C++ in WINE.

(Just in case, you did not know Santa's email address, it's 'julliard[at]winehq.org', and you can make your wishes at 'wine-devel[at]winehq.com'..)

You see, Santa was always so good - he answered people's prayers and got together his obedient elves to run Win32 on Non-Windows platforms!

However, soon many of his elves found out that technologies like MFC, WTL, ATL, COM, DCOM, COM+ and other MS bloops were getting too complex to be implemented using plain C, and thus developments in those areas were soon in limbo.
But that could be solved using yet another language called C++ - if only Santa would let it be.

Oh please Santa ! Let us adultrate WINE with C++, please.

It's not that we will rewrite everything in C++ once we get the green signal - things like the loader, scheduler, and most of the Win32 SDK does not need C++ at all, but what about MFC, COM, OLE ?

Not that I expect to compile native MFC source using WineLib, but at least we can write the runtimes so that native MFC apps can atleast run under WINE ?

DirectX oozes of classes,inheritance,abstaction and everything C++ as does OLE, COM and already our implementations have structure object pointers running wild, whereas encapsulation would have done away with it !

As a simple explanation, we might take our 'This' hack wheras C++ would let have us use it as 'this' without even us worrying about it !
Also, there are many places in shell32, ole and shwlapi (I cannot comment on DirectX source as I do not have a graphics base at all ..) where initializing a few member variables from a constructor would have done away with some redundancy.

Most of the time we are passing around multilevel pointers when a simple reference would have done:

For example a call like

Stream_LoadString( stm, unicode, &This->sString ); [To 'static HRESULT Stream_LoadString( IStream* stm, BOOL unicode,LPWSTR *pstr )']

can be made to a simple

Stream_LoadString(sString);

using C++ if we had the prototype rewritten to 'static HRESULT Stream_LoadString(LPWSTR& pstr )' and making it a member function of IStream (and thus the 'IStream* stm' and 'BOOL unicode' would be member variables..)

We have code like that all over the place whenever COM etc comes into play and "That's Not A Good Thing(TM)" !

Please give us the green card - alternately, a new test branch may also be created just to see if C++ would work.All C++ based modfications would goto that tree.
If that test branch works and delivers, it maybe merged into the main WINE tree, otherwise if it fails 


More information about the wine-devel mailing list