Translating parts of WTL to D

Lionello Lunesu lio at lunesu.remove.com
Thu May 18 06:53:59 PDT 2006


Jarrett Billingsley wrote:
> "Lionello Lunesu" <lio at lunesu.remove.com> wrote in message 
> news:e4hiuv$1af1$1 at digitaldaemon.com...
> 
>> but it's not quite as usable as the C++ version.
> 
> Huh?  How so? 

Take somefunc for example. C++:

#void testfunc( _U_MENUorID x = 0U ){
#  CreateWindow( ..., x.m_hMenu );
#}
#void usage(){
#  testfunc();
#  testfunc(IDM_MAINMENU);
#  testfunc(hMenu);
#}

with the 'straightforward' D conversion I need an extra check in the 
function. Also, I must create instances of the class first :(

#void testfunc( _U_MENUorID x = null ){
#  CreateWindow( ..., x?x.m_hMenu:null );
#}
#void usage(){
#  testfunc();
#  testfunc( new _U_MENUorID(IDM_MAINMENU) );
#  testfunc( new _U_MENUorID(hMenu) );
#}

L.



More information about the Digitalmars-d-learn mailing list