ListViewColumnClickEvent:NameSym IDE crash

Public support forum for peer to peer support with related to the Visual Objects and Vulcan.NET products
Post Reply
User avatar
wriedmann
Posts: 3644
Joined: Mon Nov 02, 2015 5:07 pm
Location: Italy

ListViewColumnClickEvent:NameSym IDE crash

Post by wriedmann »

Hi,
this code crashes my IDE (also in a new application based on the StandardMDI sample, and also in another project - so repo corruption can be excluded):

Code: Select all

class LVWindow inherit SplitWindow

method ListViewColumnClick( oEv ) class LVWindow
	local oEvent as ListViewColumnClickEvent

	oEvent := oEv
	if oEvent:NameSym == #Hallo   // this code line crashes the IDE
 	endif

	return super:ListViewColumnClick( oEvent )
Wolfgang
P.S. VO SP4b, build 2838
Wolfgang Riedmann
Meran, South Tyrol, Italy
wolfgang@riedmann.it
https://www.riedmann.it - https://docs.xsharp.it
ic2
Posts: 1798
Joined: Sun Feb 28, 2016 11:30 pm
Location: Holland

ListViewColumnClickEvent:NameSym IDE crash

Post by ic2 »

Hello Wolfgang,

What happens if you change line 5 to:

if oEv:NameSym == #Hallo

That's the only difference I can see with ListViewColumnClick where I also use NameSym; I do not assign the parameter to a local variable.

Otherwise feel free to send that testproject to me so I can check what happens here,

Dick
User avatar
wriedmann
Posts: 3644
Joined: Mon Nov 02, 2015 5:07 pm
Location: Italy

ListViewColumnClickEvent:NameSym IDE crash

Post by wriedmann »

Hi Dick,
the compiler crashes only if I access the :NameSym on the strongly typed variable.
If I don't use a local variable it works (and it always worked...).
I'm using similar code to strongly type the passed events in many places of my application, but only with this event the compiler crashes.
Wolfgang
Wolfgang Riedmann
Meran, South Tyrol, Italy
wolfgang@riedmann.it
https://www.riedmann.it - https://docs.xsharp.it
ic2
Posts: 1798
Joined: Sun Feb 28, 2016 11:30 pm
Location: Holland

ListViewColumnClickEvent:NameSym IDE crash

Post by ic2 »

Hello Wolfgang,
wriedmann wrote:Hi Dick,
the compiler crashes only if I access the :NameSym on the strongly typed variable.
Does the compiler crash? Or your program when you run that line?

What you are doing is actually exact what is recommended in the help (never realized that until now):

Most of the accesses/assigns of the event classes have been strongly typed in Visual Objects 2.8 for performance reasons. We strongly advise you to take advantage of this by assigning unsigned Event handler parameters to typed local parameters.

Probably Robert can say something about it when he's back from holiday.

Dick
Karl-Heinz
Posts: 774
Joined: Wed May 17, 2017 8:50 am

ListViewColumnClickEvent:NameSym IDE crash

Post by Karl-Heinz »

Hi Wolfgang,

Same error is thrown with SP3. It would be interesting to see what happens if the X # Compiler + X # VO GUI is used. If it works - as i expect - the method would be a #IFDEF __XSHARP__ candidate.

regards
Karl-Heinz
User avatar
wriedmann
Posts: 3644
Joined: Mon Nov 02, 2015 5:07 pm
Location: Italy

ListViewColumnClickEvent:NameSym IDE crash

Post by wriedmann »

Hi Dick,

yes, it is the compiler that crashes the IDE.

Wolfgang
Wolfgang Riedmann
Meran, South Tyrol, Italy
wolfgang@riedmann.it
https://www.riedmann.it - https://docs.xsharp.it
User avatar
wriedmann
Posts: 3644
Joined: Mon Nov 02, 2015 5:07 pm
Location: Italy

ListViewColumnClickEvent:NameSym IDE crash

Post by wriedmann »

Hi Karl-Heinz,

if this is occurring also in SP3, an error in the repo generation can be excluded....

And I cannot immagine that this compiler crash is also occuring in X#.

In plain X# most of the times a cast would be enough, but in VO casts to an object are not possible - another strong point in favor of X#.

Wolfgang
Wolfgang Riedmann
Meran, South Tyrol, Italy
wolfgang@riedmann.it
https://www.riedmann.it - https://docs.xsharp.it
User avatar
wriedmann
Posts: 3644
Joined: Mon Nov 02, 2015 5:07 pm
Location: Italy

ListViewColumnClickEvent:NameSym IDE crash

Post by wriedmann »

Hi Karl-Heinz,

as suspected: this code does not crashes the X# compiler in a ported VO application that uses the VO compatible GUI classes delivered with X# Bandol RC2.

Wolfgang
Wolfgang Riedmann
Meran, South Tyrol, Italy
wolfgang@riedmann.it
https://www.riedmann.it - https://docs.xsharp.it
User avatar
robert
Posts: 4225
Joined: Fri Aug 21, 2015 10:57 am
Location: Netherlands

ListViewColumnClickEvent:NameSym IDE crash

Post by robert »

Wolfgang,

I can reproduce this here.
If you change the the type of the event to ControlNotifyEvent then it compiles.

Robert
XSharp Development Team
The Netherlands
robert@xsharp.eu
User avatar
wriedmann
Posts: 3644
Joined: Mon Nov 02, 2015 5:07 pm
Location: Italy

ListViewColumnClickEvent:NameSym IDE crash

Post by wriedmann »

Hi Robert,

thank you very much for confirming it.

Wolfgang
Wolfgang Riedmann
Meran, South Tyrol, Italy
wolfgang@riedmann.it
https://www.riedmann.it - https://docs.xsharp.it
Post Reply