Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

v193 can't match event with handler #1389

Closed
dmrvb opened this issue Dec 1, 2022 · 18 comments
Closed

v193 can't match event with handler #1389

dmrvb opened this issue Dec 1, 2022 · 18 comments

Comments

@dmrvb
Copy link

dmrvb commented Dec 1, 2022

v193 feels like another huge leap forwards. Thankyou. Is it helpful to report bugs now or is there another release in progress?

I see lots of "unable to match this handler to its event member"
some of the events causing this are:
SStab_click
SStab_mousedown
SStab_mousemove
updown_mousemove
toolbar_mousedown
plus others

Also a gentle reminder that Zorder is still not implemented, my Problems pane is full of yellow warnings. 😄

Desktop (please complete the following information):

  • OS: [e.g. Windows 11]
  • twinBASIC compiler version [193]
@WaynePhillipsEA
Copy link
Collaborator

Interesting. VB6 doesn't care if there is a mismatch of ByVal/ByRef specifiers for event handlers, so for example SSTab Click is actually defined in the type library as Private Sub SSTab1_Click(ByVal PreviousTab As Integer) but VBx allows, and defaults to Private Sub SSTab1_Click(PreviousTab As Integer). twinBASIC currently fails to match them up as it sees them as incompatible signatures.

@wqweto
Copy link

wqweto commented Dec 2, 2022

Btw, this is not allowed on (early-bound) classes in VB6 and bombs with

---------------------------
Microsoft Visual Basic
---------------------------
Compile error:

Procedure declaration does not match description of event or procedure having the same name
---------------------------
OK   Help   
---------------------------

Sample code:

'--- Class1
Option Explicit

Event Click(ByVal PreviousTab As Integer)
'--- Form1
Option Explicit

Private WithEvents m_oInstance As Class1

Private Sub m_oInstance_Click(PreviousTab As Integer) '<---- does not compile
    '
End Sub

For user-controls the IDE prepares some proxies/wrappers so all sited controls are actually called late-bound through these generated wrappers and some of their events are with changed signatures (pixels<->twips conversions) and new "extender" events are added in the process.

@WaynePhillipsEA
Copy link
Collaborator

Thanks @wqweto. I have put a fix for this in the next release which only applies to dispinterface source interfaces, so that should match. However, I will check this example you gave before release.

@WaynePhillipsEA
Copy link
Collaborator

Fixed in BETA 194, thanks!

@dmrvb
Copy link
Author

dmrvb commented Dec 2, 2022

reOpened
This error is still present in v195 (I have not looked at v194)

@dmrvb
Copy link
Author

dmrvb commented Dec 2, 2022

errors also present in 194

@WaynePhillipsEA
Copy link
Collaborator

Hmm, certainly SSTab_Click looks fixed here...

Ah OK, SSTab_MouseDown / SSTab_MouseMove etc are still broken. I'll get them fixed tomorrow.

@dmrvb
Copy link
Author

dmrvb commented Dec 2, 2022

Listbox Itemcheck
ListView mousedown
updown mousedown mouseup
toolbar mousedown
SStab mousedown mousemove mouseup
and just maybe a couple more.
I still struggle to navigate through a big list in the problems pane, up down keyboard keys don't work so doing it on the scrollbar which is not ideal but sort of ok with the mousewheel.

@WaynePhillipsEA
Copy link
Collaborator

These should be fixed in BETA 196. Let me know if you find any that are still not correct. Thanks

@dmrvb
Copy link
Author

dmrvb commented Dec 3, 2022

Listbox Itemcheck.
I will go through some other projects and look for any more but probably not till tomorrow.

@WaynePhillipsEA
Copy link
Collaborator

What ListBox are we talking about here? The builtin one?

@dmrvb
Copy link
Author

dmrvb commented Dec 3, 2022

I think so, or it could be a ListView. I will look now and can't find any others

@dmrvb
Copy link
Author

dmrvb commented Dec 3, 2022

Yes, its the built in listbox.

@dmrvb
Copy link
Author

dmrvb commented Dec 3, 2022

I have a big real world outside project on today so no more software input till very late evening or tomorrow

@WaynePhillipsEA
Copy link
Collaborator

No problem, and thanks for the info

@dmrvb
Copy link
Author

dmrvb commented Dec 3, 2022

Issue still present in v197.
in VB6 the event is List1_ItemCheck(Item As Integer)
in tB its (item as long).
This causes imported VB6 code to generate the error.
Changing to (Item as Long) fixes it.
I am happy to do this but to get full VB6 compatibility I assume it need sorting out?

@WaynePhillipsEA
Copy link
Collaborator

Yeah sorry I didn't get chance to look at that today. Will fix tomorrow, cheers.

@WaynePhillipsEA
Copy link
Collaborator

Fixed in BETA 198. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants