XS1030 #warning: 'Callback function modified to use a DELEGATE by xPorter.
Posted: Mon Mar 02, 2020 11:13 pm
Another new thing although searching on it the warning seems to be present since 2017...but I can't remember seeing it earlier... This is not my code, but the ACF-Shell Window to allow gradient fills, background text etc.
Original code
// Subclass our MDI Client
hClient := SELF:Handle( 4 )
SetWindowLong( hClient, GWL_WNDPROC, LONG( _CAST, @ACF_MdiClientWinProc() ) )
XS1030 #warning: 'Callback function modified to use a DELEGATE by xPorter. Please review:
xPorter result
hClient := SELF:Handle( 4 )
#warning Callback function modified to use a DELEGATE by xPorter. Please review.
// SetWindowLong( hClient, GWL_WNDPROC, LONG( _CAST, @ACF_MdiClientWinProc() ) )
STATIC LOCAL oACF_MdiClientWinProcDelegate := ACF_MdiClientWinProc AS ACF_MdiClientWinProc_Delegate
SetWindowLong( hClient, GWL_WNDPROC, LONG( _CAST, System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate(oACF_MdiClientWinProcDelegate) ) )
Wolfgang explained in https://www.xsharp.eu/forum/german/1668 ... ssen#12283 more about delegates but frankly I have no idea if the generated code could work.
In a final real life conversion I would most likely prefer to search a better solution than using old code I didn't write and which seems to 'break in' into all kind of default VO/Windows behavior. Chances are that this ain't going to work anyway. But for now I would like to understand what this is supposed to do. There are a few more, like GetWindow, SubClassWindow
DIck
Original code
// Subclass our MDI Client
hClient := SELF:Handle( 4 )
SetWindowLong( hClient, GWL_WNDPROC, LONG( _CAST, @ACF_MdiClientWinProc() ) )
XS1030 #warning: 'Callback function modified to use a DELEGATE by xPorter. Please review:
xPorter result
hClient := SELF:Handle( 4 )
#warning Callback function modified to use a DELEGATE by xPorter. Please review.
// SetWindowLong( hClient, GWL_WNDPROC, LONG( _CAST, @ACF_MdiClientWinProc() ) )
STATIC LOCAL oACF_MdiClientWinProcDelegate := ACF_MdiClientWinProc AS ACF_MdiClientWinProc_Delegate
SetWindowLong( hClient, GWL_WNDPROC, LONG( _CAST, System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate(oACF_MdiClientWinProcDelegate) ) )
Wolfgang explained in https://www.xsharp.eu/forum/german/1668 ... ssen#12283 more about delegates but frankly I have no idea if the generated code could work.
In a final real life conversion I would most likely prefer to search a better solution than using old code I didn't write and which seems to 'break in' into all kind of default VO/Windows behavior. Chances are that this ain't going to work anyway. But for now I would like to understand what this is supposed to do. There are a few more, like GetWindow, SubClassWindow
DIck