in my VO applications, I have many calls like this:
Code: Select all
method ReceiveBroadcastMessage( symServer ) class AnAuftragEdit
do case
case symServer == #MAuftrag .and. oDCTabControl:IsCreated( #AnAuftragSubEdit1 )
oDCTabControl:GetPage( #AnAuftragSubEdit1 ):CheckMontageAuftrag()
endcase
return nilCode: Select all
method ReceiveBroadcastMessage( symServer ) class AnAuftragEdit
do case
case symServer == #MAuftrag .and. oDCTabControl:IsCreated( #AnAuftragSubEdit1 )
#ifdef __XSHARP__
( ( AnAuftragSubEdit1 ) oDCTabControl:GetPage( #AnAuftragSubEdit1 ) ):CheckMontageAuftrag()
#else
oDCTabControl:GetPage( #AnAuftragSubEdit1 ):CheckMontageAuftrag()
#endif
endcase
return nilCode: Select all
method GetPageNative<T>( uPage as usual ) as T
local oReturn as T
oReturn := ( T ) self:GetPage( uPage )
return oReturnCode: Select all
error XS0030: Cannot convert type 'VO.Window' to 'T'My question now is, if it is a good idea to build a generic function for such code pieces, and it that is possible.
I have to admit that I'm inspired by the PCallNative() function.
Wolfgang

