xsharp.eu • Strange issue with transported applications - Page 2
Page 2 of 2

Strange issue with transported applications

Posted: Wed Feb 26, 2020 8:20 am
by wriedmann
Hi Chris,
thank you very much, I have my solution now:

Code: Select all

class DynMenu inherit Menu
	protect _aMenuItems 		as array		// The item of the menu
	protect _aAcceleratorKeys	as array		// The accelerator keys
	protect _aMenuChoices		as array		// array of descriptions and associated methods
	protect	_aMethodIDs		as array		// The methods and ID's
	protect _oKeys				as DynMenuAcceleratorKeys // added

method ActivateAcceleratorKeys( oOwner )

	// Create an accelerator class instance from the keys registred with this menu
	_oKeys				:= DynMenuAcceleratorKeys{ self:AcceleratorKeys } // using the protect and not more the local variable

	// Set the AcceleratorKeys for this menu
	self:Accelerator	:= DynMenuAccelerator{ GetNextMenuID(), _oKeys:GetAcceleratorHandle }
	if IsInstanceOfUsual( oOwner, #Window )
		SetAccelerator( oOwner:Handle(), self:Accelerator:Handle() )
	endif

	return self:Accelerator
Thank you very, very much!

Wolfgang

Strange issue with transported applications

Posted: Wed Feb 26, 2020 10:45 am
by Chris
Hi Wolfgang,

Good catch, glad you have it working now! Btw, an alternative way to fix it would be to change the LOCAL into a STATIC LOCAL, which also retains its value. Both ways are totally fine of course.

Strange issue with transported applications

Posted: Wed Feb 26, 2020 10:48 am
by wriedmann
Hi Chris,
yes, I'm really happy that it works now.
But without the help from Karl-Heinz (the combination with resizing) and from you (the hint with the GC) I would never have solved it.
Wolfgang